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"
[efb_likebox fanpage_url="https://www.facebook.com/vbamarket/" box_width="840" box_height=340"" responsive="1" show_faces="1" show_stream="1" hide_cover="1" small_header="0" hide_cta="0" locale="en_US"]