Adding a validation check

migrif

Registered User.
Local time
Today, 14:33
Joined
Jul 14, 2008
Messages
15
I want to add a check to a form to see if a duplicate value exists. I have done this with a table by using no duplicates allowed. In this case, I want duplicates, but just want to be made aware of them, not a hard stop. Any ideas where in the field properties I can do this? Am I in the right direction under the data tab and Validation rule?
Thanks in advance.
 
Actually, in the form's Before Update event you can use a DCount to look for how many matches:

MsgBox "There are " & DCount("[YourFieldNameHere]", "YourTableOrQueryNameHere", "[KeyFieldNameHere] = " & Me!YourKeyField) & " existing records that match"
 
That's perfect!!
Thanks
 

Users who are viewing this thread

Back
Top Bottom