Duplicate Issue

  • Thread starter Thread starter SeRene
  • Start date Start date
S

SeRene

Hello,

I have a scenario which goes like this,
I have to import data from a text file into my access
table daily. I have provided a command button for the user
to auto import the data from the txt file (made use of
macro - TransferText).
The problem now is, how can i prevent the same set of data
from appearing in the access table if the user
accidentally click on the command button for importation
more than once?
 
SeRene

Add an index to the underlying table that won't allow duplicates. If there
are more than one column that need to be unique, create the single index on
all the columns at once. This will prevent "duplicate" data from being
appended.
 
If you will be appending records to an existing table, you could create a
new multi-field index (such as Lastname,Firstname,homephone, etc); set it to
"unique-no duplicates. When you attempt to add records that already exist,
you'll get an error message for "# records not added due to key conflicts".

You could also import your records into an entirely different table each
time, then
run a query to find and append only the unduplicated records to your
existing table.

-Ed
 
Back
Top