Sohaila Taravati
12-17-2001, 12:47 PM
I have a database for our employees. The database opens up by asking them their Social Security Number. Everything works fine, except when they put in the wrong SS#, the form opens up blank. I want to be able to put in an error message that would tell them that this SS# is not correct or does not exist, try again. I know how to do that with not in the list for the Combo box, but I don't know how to do that behind the actual form. I would appriciate it if anyone could help. Thanks in advance, you are all great! http://www.access-programmers.co.uk/ubb/smile.gif
stwalker
12-17-2001, 01:37 PM
Have you tried basing the field off a recordset and using the .NoMatch property?
Mitch_____W
12-18-2001, 06:16 AM
Possibly you could use something like this code for the <On Open> event for that form:
If ["Your Social Security # Feild Name"] Is Null Then
MsgBox "Wrong Social Security Number", vbCritical, "TRY AGAIN!!;
DoCmd.RunCommand acCmdCloseWindow
DoCmd.Close acForm, "Your Form Name", acSaveNo
End If
After they enter the SSN the form tries to open but checks to see if it will be blank and if it is then the message box opens telling the user that the wrong number has been entered and after the user clicks OK on the message box, the form closes.
Mitch