updating table from excel

ga11ardo

Registered User.
Local time
Yesterday, 22:05
Joined
Sep 26, 2007
Messages
13
In my access database I have a "products" table which contains three concerning columns (pID, price, listprice) This table contains products from hundreds of different suppliers. Periodically, each supplier will send an updated price list containing the three pieces of information listed above.
My question is, is there any way to automate the following three processes:
1) if the product ID already exists. update to the new price
2) if the product ID doesn't exist add the new product and price
3) if a product has been discontinued, delete the record (this part not a necessity, but would be nice)

Thank you in advance for any help, if you have any other questions please ask
 
Use 3 different queries:
An update query. In the where clause "where inputid = pID"
An append query. In the where clause "where inputid not in (select pID from alreadytheretable)"
A delete query. In the where clause "where pID not in (select inputid from inputtable)"

Run them sequentially. When it's right, put it in a subroutine using docmd.
 

Users who are viewing this thread

Back
Top Bottom