Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 6th, 2004, 09:59 AM
Authorized User
Join Date: Jun 2003
Location: , , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default prevent duplicate customers when importing data

I have a customer table, tblCustomer. I get updated additional customers from the web in an Excel spread sheet. When new customers are added it is included with the previous customers so I need a way to prevent customers already in the database from being added since I would result in duplicate customers.

When I import these new customers how can I prevent adding customers that are already in the database?

Reply With Quote
  #2 (permalink)  
Old August 6th, 2004, 10:31 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

Don't import your data directly into tblCustomer. Import it into a temp table that has the same structure as tblCustomer. Make sure that in tblCustomer that Customer ID is a unique primary key.

After you import the data into a temp table, then use an append query to append the new data from the temp to tblCustomer. Because the Customer ID is a primary key set to INDEXED - NO DUPLICATES, Access will reject the duplicates based on Customer ID.

If your spreadsheet doesn't have Customer ID, then you'll have to create a unique key based on a combination of Last Name + First Name + Address or something like that.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent displaying duplicate infromation in xsl Indy1304 XSLT 1 July 28th, 2008 11:13 AM
customers table missing harvtim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 September 25th, 2007 03:17 AM
Prevent sensitive data to be written on HDD narkobaron Visual C++ 0 April 12th, 2007 10:35 AM
SSIS: Use filename as data when importing data slesicki SQL Server 2005 0 August 7th, 2006 05:00 PM
Trying to upgrade customers' database jeffcflam Pro VB 6 2 June 15th, 2005 01:49 PM

All times are GMT -4. The time now is 08:14 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.