I would like to create a form in which a user can click on a buttom to restore an access table from a disk (text file).
I would like the data from the disk file to overlay what is in the table. Can this be done?
By Replace I'd mean blow the old table away completely and Import the new data into a table defining the field names and types on the fly
By Overwrite I'd mean leave ll existing record in place and take records from the text file, match to existing records and write all available data to the relevant fields; if no records exist then append.
Look at DoCmd.TransferText
I think that will do what you need.
'ope-that-'elps.
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
1. Create a link to the text file on disk (table A).
2. Delete all records from the database table (table B).
3. Import (append) records from table A to table B.
However, before you run any code that deletes all records from your table, you should take some precautions. For example, what will you do if the text file is damaged and you've all ready deleted everything from table B?
I would make a backup copy of table B first. Then, if necessary, you can restore the data from the backup copy to table B.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.