ChampionDuy
Registered User.
- Local time
- Today, 00:12
- Joined
- Mar 14, 2002
- Messages
- 94
I have a form where the user enters a SSN and when the user tries to exit the field code makes sure that the SSN does not exist in the database. If it does the user is not allowed to exit the field untill the user enters in a valid SSN. However when a user enters in a invalid SSN a message that I generate alerts the user of an invalid SSN. The problem is another message appears generated by ACCESS.
It says
"The Value in the field or record violates the validation for the record or field"
How can I get rid of that message? I tried the DoCMD.Setwarnings False, I tried to capture it with an error handler but neither one of those worked.
Here is my code.
If Not IsNull(DLookup("T_SSN", "tblTrueAgent", "T_SSN = '" & Me!T_SSN & "'")) Then
MsgBox "Agent with that SSN already Exists, Please enter in a new SSN."
Cancel = True
End If
It says
"The Value in the field or record violates the validation for the record or field"
How can I get rid of that message? I tried the DoCMD.Setwarnings False, I tried to capture it with an error handler but neither one of those worked.
Here is my code.
If Not IsNull(DLookup("T_SSN", "tblTrueAgent", "T_SSN = '" & Me!T_SSN & "'")) Then
MsgBox "Agent with that SSN already Exists, Please enter in a new SSN."
Cancel = True
End If