Need to overwrite record when importing text

  • Thread starter Thread starter chilko
  • Start date Start date
C

chilko

Guest
I am running a macro and need it to overwrite any record where the part number is the same and insert a new record where the part number does not exist.
In my attempts at this with text import, I get the message that MS Access was unable to append; 0 records were deleted and 2 records were lost.
I have the Column PartNum as a key field with no duplicates set. It is set as text because the part number may have alpha characters.
I am importing a csv file.

Can I do this with the TransferText or must I use VBA?
Thanks
 
Last edited:
First, do not use macros. Exception: Autoexec macro.

See:

http://www.utteraccess.com/forums/showflat.php?Cat=&Number=547442&Main=547442

What I might try would be to link to the text file as a linked table. Then run two queries against the table, the first would be an update query, which would update all records that exited in the db that had the same ID #, with the new values.

Then an append query, that would append all new records that did not have an ID # already in the db.

HTH :cool:
 

Users who are viewing this thread

Back
Top Bottom