APPEND Data without duplicated data

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

Guest

Hey guys, maybe it is a silly question, but I don't know that much of ACCESS...

How can I append data to a Table checking if the new data is already in the
table?
I mean, I want to avoid duplicated data based on only some fields, not all
of them.

Is this possible?

Thanks. Bregards

Santiago
 
Make the combination of the fields that make the record unique either the
primary key or a unique index. Access will not let you append any duplicate
records that way.

Or you could write a fancy query with a subquery that first checks if the
data is not already in the table. This could be very slow depending on the
number of records in the table.
 
Thanks Jerry. Seems it would work.

But will it display an error message or it will not add the repeted records
to the database?

I guess I can just try ...
 
Good question! The default behavior of Access it to throw up an error message
and if you say OK Access allows in the records that do not violate the
constraint. You can stop the irritating error message by setting warnings
off, doing the append, and setting warnings back on. Don't forget to set
warnings back on! You can do this in code or even a macro.
 

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