Transfer Text and Overwrite

A

Agnelo Fernandes

Hi,

I have set-up a 'transfer text' macro to Import a CSV delimited text into
Access.
However, everytime i run the macro it APPENDS the data rather than
overwriting it.

Is there a way to overwrite the imported data everytime i run macro ?

Cheers
 
P

PieterLinden via AccessMonster.com

Agnelo said:
Hi,

I have set-up a 'transfer text' macro to Import a CSV delimited text into
Access.
However, everytime i run the macro it APPENDS the data rather than
overwriting it.

Is there a way to overwrite the imported data everytime i run macro ?

Cheers

you would have to link to the CSV file (File, Get External Data, Link...)
and then probably do the easy thing, update the records that already exist
(join the two tables on the unique ID). Then create an append query using
the Find Unmatched wizard. Then call the two in sequence... something like

DBEngine(0)(0).Execute "yourUpdateQuery"
DBEngine(0)(0).Execute "yourAppendQuery"

(you would have to do them from a VBA module (a function). and then you can
call the function from your macro.)
 
Top