Still trying to get my head around vba code. Perhaps one of you has some sample code that will help.
I have a form to enter new employee names.
Before saving the new entry, I would like ACCESS to check the existing table records to see if the new name already exists.
If so, then the user should be asked whether he/she is sure about creating a new record for this name. (He/she should be able to choose "Yes" because there could be people with the same first and last names).
Here is some additional info which may be useful:
tablename is Employee
fields include:
EmpId (PK)
FirstName
LastName
JoinDate
formname is frmAddNewEmployee
textbox for First Name is ubdFirstName
textbox for Last Name is ubdLastName
[NOTE: Entries in the unbound textboxes are later transferred into the "real" textboxes after the edit checks].
Can anyone suggest some code that will alert users of the potential duplicate entry, yet still allow them the option of adding the new record anyway?
Thanks.
I have a form to enter new employee names.
Before saving the new entry, I would like ACCESS to check the existing table records to see if the new name already exists.
If so, then the user should be asked whether he/she is sure about creating a new record for this name. (He/she should be able to choose "Yes" because there could be people with the same first and last names).
Here is some additional info which may be useful:
tablename is Employee
fields include:
EmpId (PK)
FirstName
LastName
JoinDate
formname is frmAddNewEmployee
textbox for First Name is ubdFirstName
textbox for Last Name is ubdLastName
[NOTE: Entries in the unbound textboxes are later transferred into the "real" textboxes after the edit checks].
Can anyone suggest some code that will alert users of the potential duplicate entry, yet still allow them the option of adding the new record anyway?
Thanks.