Overwrite data on Import of Transferspreadsheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks to all the nice people that helped me out earlier.
I need to refresh an Access table from an external Excel file everyday,
Using a macro to do this would require me to use the "Transferspreadsheet"
function. But this function adds data into the existing table, creating
doubles. Is there a way to overwrite existing data on a table instead of
adding data into it during "transferspreadsheet"? Any automated import
function that would clear away yesterday's table and create a new one would
also work..if it can be done.
 
Before you do the TransferSpreadsheet action, run a delete query that
deletes all the current records from the table where you want to put the
data from the TransferSpreadsheet action.
 
Thanks for the quick help. Your input has solved the problem.
For others who would want to do this, I'd advise creating 3 separate macros
for this task;
1. Runquery = where a delete query is initiated
2. Transferspreadsheet = where the deleted data is replenished
3. Macro to run 1 and 2.
(The 3 macros was necessary bec it wouldnt function right if the first 2
actions are combined in one macro).


Ken Snell said:
Before you do the TransferSpreadsheet action, run a delete query that
deletes all the current records from the table where you want to put the
data from the TransferSpreadsheet action.
 
Back
Top