DoCmd.TransferDatabase / overwrite

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

How can you "overwrite" a table "without"
TableABC becomeing TableABC1 then TableABC2, etc

I want to import a whole table (structure and data) from another DB into the
current DB

I have tried deleteing the table then importing - but the code stops after
the delete.

Private Sub SomeButton_Click()
DoCmd.DeleteObject acTable, "SomeTable"
Exit Sub
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\Documents and
Settings\UKOPS\My Documents\UKOP_Stuff\Copy (2) of merchant.mdb", acTable,
"SomeTable", "SomeTable", structureonly:=False
End Sub

And just using DoCmd.TransferDatabase causes the table to add as 1 then 2
then 3 etc as above.

Any ideas would be helpful
 
Your code is stopping after the delete operation due to the "Exit Sub".

If you remove this, then you should get the import to take place.
 
ooops

Forgot that - LoL.

I am getting worse at this stuff.

Thank for pointing that out.

I spent 3 hours today trying to load a new copy of XP onto a laptop and it
was one of the admin assistants who pointed out thAT one of my "A's" was in
fact a "4". I am getting to old for this.

Thanks again.
 
Your welcome, Wayne.

Don't beat yourself too much, we've all "been there, done that". :)

Mr B
 
Back
Top