VBA SQL copy table from one database to another

VBA SQL copy table from one database to another

This VBA will copy a Access Table from one Database into another.  You will copy the below VBA into the current database that you want to transfer the table from.  Update the Tbl_Names and filepath for the database you’re transferring the table to.

DoCmd.RunSQL "DELETE FROM Tbl_NameTransferTo IN 'X:\MyDocument\MyDatabase.accdb'"
DoCmd.RunSQL "INSERT INTO Tbl_NameTransferTo IN 'X:\MyDocument\MyDatabase.accdb' SELECT * FROM Tbl_NameTransferFrom"