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"
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: