prevent duplicate entries

G

Gary

i have a form to enter people by: last name, first name, dob. they are all
indexed. how do you get a message of "duplicate" if all the fields are the
same after entering the last entry dob.
 
A

axeman422

easiest way I can think of is to add 1 more column to your table that has all
3 values of the others
you can use a string to populate the new column with all the other values
added to it.

DoCmd.RunSQL "update Table1 set [allinfo] = [last name] & [first name] &
[dob]"

if you set the new column indexed to yes (no duplicates) before running the
string when it gets to a duplicate 1 it will leave it blank so you could go
in to table and filter new column and delete the ones with blank in that
column then you are duplicate free change the filter back to how you want it

then it would be a matter of changing the part where you add in new names
and such to include updating the new column with the
[last name] & [first name] & [dob]
and it would tell you if 1 already existed with the same values

well thats how I see getting around your problem anyway
 
Top