importing data from a table to another table without adding duplicates?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

swebster

Thread Starter
Joined
Oct 3, 2002
Messages
5
I have different mailing lists that I want to add to a mailing list in my database. There may be duplicate addresses in these lists. I want to only add an Address, FirstName, LastName record once. So how do I combine these lists with my original list without adding a duplicate Address, FirstName, LastName record?
 
Joined
Oct 13, 2000
Messages
941
Unless you can program in VBA, you can't. But there's a workaround: Import all your data, then create a query based on the table using the find duplicates query wizard. It walks you through the query creation, allowing you to pick what fields may contain duplicate data, etc.

You may then select and delete records based on duplicates. You will only have to build the query once, and then you'll be able to run it each time you import.
 

swebster

Thread Starter
Joined
Oct 3, 2002
Messages
5
Thanks for your tip. I am curious, though, as to how to code it in VBA. I am currently learning VBA and SQL.
 
Joined
Oct 13, 2000
Messages
941
Well, the fast answer is: load two recordsets; one into which you're appending records, the other from which the records are coming; rstBefore and rstAfter, let's say.

Then you use a find/seek method (depends what kind of recordset you open, and whether you're using DAO or ADO) to search through rstAfter trying to match whichever field value(s) you have in rstBefore. If you find them, you don't add the record; if you don't find them, you do.

Straightforward to explain, and fairly simple coding if you're used to working with recordsets. You might want to look in VBA help for more details about them.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top