warning of possible duplicate record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a 'text' field for the account number.

How can I set up a "warning message" to the user when a new record could be
a duplicate.

For example: existing account number N-5189
New account number N5189 or 5189-N

I'd like to give the user the option of:

1) See the existing account (in a new window to find out if it is the same)
2) Ignore the warning and go ahead with the new record anyway.

Thank you!
 
In the form's BeforeInsert event, you'll have to put logic that does the
"fuzzy" lookups in which you're interested (using a recordset, or DLookup).
If they come back positive (i.e.: you find a potential match), ask the user
(using a MsgBox) whether they want to continue, or see the existing
account(s). If they say Yes, open a Modal window that displays the matching
data. Once that form has closed, if they say they don't want to save the
record, set Cancel = True in the BeforeInsert event, and undo their changes
(Me.Undo)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top