G
Guest
I would like my users to get an error message when they put in a duplicate
name in my database. I have the database set up so it will not accept
duplicates but I'd still like them to get a message. This is my code that is
attached to an on click:
If Not IsNull(DLookup("Employee", "Census", "employee")) Then
MsgBox "This user has previously been added, please click Existing User on
the previous screen. Click OK to be redirected to the previous screen."
DoCmd.Close
End If
Me![Hide input info].Visible = False
The question is: Why does my error show up whether the name is duplicate or
not.
Employee is the field on the table Census and employee is the combo box on
the form. Oh, and Hide input info is an opaque box - it should disappear if
the above DLookup comes up with nothing.
You all have been so much help to me recently. Thanks again for any help
you can provide! Please let me know if there is any additional information
that would be helpful as well.
-Jenny
name in my database. I have the database set up so it will not accept
duplicates but I'd still like them to get a message. This is my code that is
attached to an on click:
If Not IsNull(DLookup("Employee", "Census", "employee")) Then
MsgBox "This user has previously been added, please click Existing User on
the previous screen. Click OK to be redirected to the previous screen."
DoCmd.Close
End If
Me![Hide input info].Visible = False
The question is: Why does my error show up whether the name is duplicate or
not.
Employee is the field on the table Census and employee is the combo box on
the form. Oh, and Hide input info is an opaque box - it should disappear if
the above DLookup comes up with nothing.
You all have been so much help to me recently. Thanks again for any help
you can provide! Please let me know if there is any additional information
that would be helpful as well.
-Jenny