DoCmd.TransferDatabase / overwrite

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
 
G

Guest

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.
 
G

Guest

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.
 
G

Guest

Your welcome, Wayne.

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

Mr B
 

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