Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append table with only new data from linked excel table

Status
Not open for further replies.

grantc

Technical User
Mar 1, 2001
14
0
0
NZ
I have an existing packing slip access app that works really well, however I am wanting to update/append the stock inventory table from a linked excel table [excel data may change from time to time], but I only want to add new records from the excel table. I tried using an append query but the number it wants to add thousands of rows every time I run it,

Is there a faster method of only appending records from the excel table that don't already exist in the stock table?

Thanks
 
Hi

A new record is a StockCode [part number] that doesn't exist in stock table

i.e
tblStock
[StockID] - Autonumber
[StockCode]
[StockDescription]


tblExcelStock
[StockCode]
[StockDescription]

I only want to append tblstock with entries from tblExcelStock that don't already exist. [StockCode]is the field being used to compare for new records.
 

INSERT INTO MyAccessTable ( field1, field2, field3..... )
SELECT field1, field2, field3.....
FROM linkedexcelltable
left JOIN MyAccessTable ON MyAccessTable.StockCode = linkedexcelltable.StockCode
WHERE (((MyAccessTable.StockCode) Is Null));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top