P
Paul
I have a subform that lists contacts, where the primary key field is
ContactID. The user adds new contacts to the subform by making a selection
in the ContactID combo box.
The compound primary key in the table underlying the subform recordset will
not allow duplicate entries, but the error message it produces about
duplicate primary keys is only meaningful to developers. Most users would
have no idea what it's trying to tell them.
I'd like to put some code in the Before Update event of the combo box that
will check to see if the selected ContactID already exists in the subform
recordset, so I can display a Message Box that tells the user the contact
already exists in plain English, and then cancels the entry. (Is that
Cancel = Yes)?
What VBA code can I use to check to see if the ContactID already exists in
the recordset?
Thanks in advance.
Paul
ContactID. The user adds new contacts to the subform by making a selection
in the ContactID combo box.
The compound primary key in the table underlying the subform recordset will
not allow duplicate entries, but the error message it produces about
duplicate primary keys is only meaningful to developers. Most users would
have no idea what it's trying to tell them.
I'd like to put some code in the Before Update event of the combo box that
will check to see if the selected ContactID already exists in the subform
recordset, so I can display a Message Box that tells the user the contact
already exists in plain English, and then cancels the entry. (Is that
Cancel = Yes)?
What VBA code can I use to check to see if the ContactID already exists in
the recordset?
Thanks in advance.
Paul