Question Import Spreadsheet Question

Jameo

New member
Local time
Today, 10:22
Joined
Apr 19, 2011
Messages
9
I am importing a spreadsheet with the following code:

Code:
Sub ImportExcel()
Dim strXls As String
strXls = "UNC Address Removed For Post"
DoCmd.TransferSpreadsheet acImport, , "tblStockImport", _
    strXls, True, "Delivery Volumes!"
 
End Sub

This works fine, however, the issue is that my import needs to be ran daily, after the import spreadsheet has been updated.

Using the above, all data in the spreadsheet becomes duplicated. Is there any way to import only 'new' data into the table? Essentially, everyday the target spreadhseet will have one additional row added. Ideally that is the only row i wish to import on a day to day basis.

Currently I am deleteing the table, creating a table and then importing. This is annoying and time consuming.

Any help will be great.

Thanks
 
Is there a field that uniquely identifies each record?
 
i would import into a temporary table and then

- use an unmatched query to find any new data, and add that to your "proper" table
- use an update query to update any changes since the last import

as vbainet says, in order to do this, you need some way of uniquely identifying a given row.
 

Users who are viewing this thread

Back
Top Bottom