Greetings,
Instead of using queries, lets try a simple code module. First, I
understand you imported 6 excel worksheets. They will be named
something like Sheet1, Sheet2, Sheet3,...
So you have created an empty table that contains the same number of
fields as each of the Sheet tables. If you did not create a table
exactly like the sheet tables -- what you can do is to just copy any one
of the sheet tables and choose only structure but not data. For my
explanation I will call the new table table1.
Now go to the Code Module tab and create a new code module and save it.
It will be saved as module11 I believe, by default. Now copy the
following code from here and paste it into your code module and rename
the sheet tables as necessary.
'--copy this code
Sub AppendData()
DoCmd.RunSql "Insert Into table1 Select * from Sheet1"
DoCmd.RunSql "Insert Into table1 Select * from Sheet2"
DoCmd.RunSql "Insert Into table1 Select * from Sheet3"
DoCmd.RunSql "Insert Into table1 Select * from Sheet4"
DoCmd.RunSql "Insert Into table1 Select * from Sheet5"
DoCmd.RunSql "Insert Into table1 Select * from Sheet6"
End Sub
Now place the mouse cursor anywhere inside
Sub AppendData()
and press the F5 key and all the data from each of the sheet tables will
be appended to table1.
Note: each of the sheet tables must be exactly alike for this to work.
They must all have the exact same number of fields.
Rich
*** Sent via Developersdex
http://www.developersdex.com ***