Lamb,
This is from the help files:
Dim intSearch As Integer, varX As Variant
intSearch = 1
varX = DLookup("[CompanyName]", "Shippers", _
"[ShipperID] = " & intSearch)
Since yours is a textbox, you'll need something like:
Dim intSearch As Integer, varX As Variant
intSearch = 1
varX = DLookup("[CompanyName]", "Shippers", _
"[ShipperID] = '" & Me.YourTextBox & "'")
If varX > 2 Then
MsgBox("Too many")
Me.YourTextBox = ""
End If
You'll have to change the item names to yours.
Notice the single-quotes added to the second example,
indicating a string value.
hth,
Wayne