append to separate database

DrOktagon

New Member
Joined
Aug 7, 2011
Messages
12
First. This board is awesome, especially Trevor G.

Here's what I need to do. I have a database with several tables, all of them have identical fields, but different records. I would like macro code that appends them all together into a table in another database. For example, the following code works to append them all to a table in the same database, but I need to append them to a table in another database because i don't have enough available memory. How can I adapt the code?

Thanks


Sub AppendData()
DoCmd.RunSQL "Insert Into table1 Select * from WOAD1995"
DoCmd.RunSQL "Insert Into table1 Select * from WOAD1996"
DoCmd.RunSQL "Insert Into table1 Select * from WOAD1997"
DoCmd.RunSQL "Insert Into table1 Select * from WOAD1998"
End Sub
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Here is what I would recommend doing.

Link all those tables to your DESTINATION database. Then run your append code directly in that Destination database.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top