prevent duplicate entries

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

Guest

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.
 
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
 

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