I have a table called Payroll and and form called Application.
When SocialSecurityNo is entered on the form, I want to search Payroll
in the field Social2 for a matching number. If a matching number is
found, I want a message box to appear appear stating Duplicate Number.
I have been using the following code but I can't seem to get it to work
right.
This code is in the after update event of socialsecurityno.
If Not
IsNull(Dlookup("[Social2]","Payroll","[Social2]=[SocialSecurityNo]"))
Then
Msgbox "Duplicate Number"
Else
Date.SetFocus
Any suggestions or maybe a better way of coding this?
Thanks!