A family of Microsoft relational database management systems designed for ease of use.
I created a generic function ListboxHasValue that you can add to your toolbox. Needs more testing, but this is the basics.
Private Sub TXTWO_AfterUpdate()
If ListboxHasValue(Me.LstWOs, Me.TXTWO) Then
MsgBox "You Can't Add Same WO Twice", vbCritical, "Duplicate Records"
Else
Me.LstWOs.AddItem Me.TXTWO
Me.TXTWO = Null
End If
End Sub
Public Function ListboxHasValue(ByRef lst As ListBox, ByVal varValue As Variant) As Boolean
Dim i As Integer
Dim blnReturn As Boolean
For i = 0 To lst.ListCount - 1
If lst.ItemData(i) = varValue Then
blnReturn = True
Exit For
End If
Next i
ListboxHasValue = blnReturn
End Function