Copying tables between databases

glove008

New member
Local time
Yesterday, 18:02
Joined
Oct 23, 2006
Messages
5
Copying tables between databases with VBA code

I'm fairly new to Access and VBA. I need to copy a table from one Access database to another one using VBA. The code is running as an action from a form that is in the database being copied into. Any help is appreciated.

My last attempt was

strSQL2 = "SELECT * INTO db1![ECPPrevALL] FROM db2![ECPPrevAll]"
DoCmd.RunSQL (strSQL2)

which gives error "Query input must contain at least one table or query"
 
Last edited:
Hello glove!

Look at attachment. There are two MDB. "DemoCopyTblFromA2000" and
"DemoCopyTblToA2000". Put the both in the same directory.
In first mdb there are 3 tables, in second there no tables.
Open "DemoCopyTblToA2000.mdb", Open Form1 in design wiew,
change PATH NAME in VBA, and try.
 

Attachments

Users who are viewing this thread

Back
Top Bottom