Importing Data when primary key already exists

G

Guest

I would like to import data from excel but the primary key already exists.
For example, the Access table contains Customer ID, Address, Phone Number.
Someone made a list with Customer ID (that are already in the database) and
their phone number. How do I import this into the Access database? I know
how to do an append query if it was a new CustomerID but not if it already
exists.
 
J

Jeff Boyce

Meghan

If the CustomerID already exists in the database, are you trying to simply
update the phone number? If so, take a look at Access HELP on update
queries.

If you are saying the CustomerID from the Excel spreadsheet matches an
already-in-use CustomerID number in the Access database, YOU have to decide
how you want that handled. Do you want to wipe out the previous CustomerID,
then give the "new" record the old ID? Do you want to add a customer and
have Access assign a CustomerID, even though it doesn't match what's coming
from Excel? Your call...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

The Update query worked great. Thanks! I thought that is was only for
updating data like increasing prices by 0.10% but now I know you can use it
other ways.
--
Thanks-
Meghan M.


Jeff Boyce said:
Meghan

If the CustomerID already exists in the database, are you trying to simply
update the phone number? If so, take a look at Access HELP on update
queries.

If you are saying the CustomerID from the Excel spreadsheet matches an
already-in-use CustomerID number in the Access database, YOU have to decide
how you want that handled. Do you want to wipe out the previous CustomerID,
then give the "new" record the old ID? Do you want to add a customer and
have Access assign a CustomerID, even though it doesn't match what's coming
from Excel? Your call...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Top