DLookup Problem

Adam McReynolds

Registered User.
Local time
Yesterday, 23:27
Joined
Aug 6, 2012
Messages
129
My problem is that I am trying to fire a warning message to prevent invalid TechID's from being SQL Inserted into a table and this "IF" statement is not firing. I think it must have to do with the "Left" statement because all of my other statements fire. Any help would be appreciated.

Code:
If DLookup("TechID", "TBL_RF_TECH_LIST", "TechID = '" & Left([txt_techid_rework_in], 2) & "'") = 0 Then
MsgBox "Please Enter a Valid TechID to Continue. Review Your Error and Correct."
Me.txt_bc1.SetFocus
Cancel = True
Exit Sub
End If
 
I suspect you want DCount() rather than DLookup().
 

Users who are viewing this thread

Back
Top Bottom