Hi,
I'm currently working on an ongoing project that requires regular updates to the forms and code of a database.
I would like to be able to click a button and import all the tables from the old version to the new one, and OVERWRITE the data.
I may add new tables in between versions, so deleting all tables before import is not an option.
my current code, does almost what i need, but it adds a number on the end, and with 50 or so tables, it's just as time consuming as the manual method.
my current code:
I am assuming I'll probably need to index the table names in a variable somewhere and delete tables mentioned in said variable.
Any suggestions will be appreciated...
I'm currently working on an ongoing project that requires regular updates to the forms and code of a database.
I would like to be able to click a button and import all the tables from the old version to the new one, and OVERWRITE the data.
I may add new tables in between versions, so deleting all tables before import is not an option.
my current code, does almost what i need, but it adds a number on the end, and with 50 or so tables, it's just as time consuming as the manual method.
my current code:
Code:
Dim db As Database
Dim tdf As TableDef
Set db = OpenDatabase("C:\Users\userdir\Desktop\stuff\BACKUPS\main backup.mdb")
For Each tdf In db.TableDefs
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\Users\userdir\Desktop\stuff\BACKUPS\main backup.mdb", acTable, tdf.Name, tdf.Name
Next tdf
Set db = Nothing
I am assuming I'll probably need to index the table names in a variable somewhere and delete tables mentioned in said variable.
Any suggestions will be appreciated...