The best way to append to many tables?

nowanda

Board Regular
Joined
May 27, 2002
Messages
67
Hello all!

I've got 1000 records in an Excel spreadsheet which I need to append into 6 different tables.

I have been able to create 6 queries to update each separate table - what is an efficient way to do the updates?

Although this below might work - there's probably another better way... isn't there?

Private Sub Get_HSBJ_info()
Dim dbsCurrent As Database
Set dbsCurrent = CurrentDb
DoCmd.OpenQuery ("IMPORT_LOGIC_table1")
DoCmd.OpenQuery ("IMPORT_LOGIC_table2")
DoCmd.OpenQuery ("IMPORT_LOGIC_table3")
DoCmd.OpenQuery ("IMPORT_LOGIC_table4")
DoCmd.OpenQuery ("IMPORT_LOGIC_table5")
DoCmd.OpenQuery ("IMPORT_LOGIC_table6")
End Sub

Nowanda:)
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
What you have looks good. I might add

DoCmd.SetWarnings False

at the beginning of your code, and

DoCmd.SetWarnings True

at the end so that it doesn't prompt you for all 6 tables.

HTH,

Russell
 
Upvote 0

Forum statistics

Threads
1,221,499
Messages
6,160,164
Members
451,628
Latest member
Bale626

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