Importing linked table from another database

  • Thread starter somanybugssolittletimetofixthem
  • Start date
S

somanybugssolittletimetofixthem

I have a form to import a table from another database. In my database this table is linked from a back end.
Whats happening is that it imports the new table as a local table leaving the old table in the back end unlinked.
Here is my code:

DoCmd.SetWarnings False
DoCmd.CopyObject , "tblHardwareOld", acTable, "tblHardware"
DoCmd.DeleteObject acTable, "tblHardware"
DoCmd.TransferDatabase acImport, "Microsoft Access", Me.txtDB, _
acTable, Me.txtTbl, "tblHardware"
DoCmd.SetWarnings True

As you can see, I want to copy the existing table to a backup before I run the import. I dont care whether thjis is saved to the back end or locally. With the above code its saved in the back end.
I tried the above code without the DeleteObject and it copied the imported table as tblHardware1 which not what I want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top