Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need best method to combine mutiple tables

Status
Not open for further replies.

RonQA

Technical User
Jun 24, 2007
61
US
I need the best method to combine mutiple tables. I want to combine 5 tables into a singe table. I have tried sever ways without success. Can it be done with VBA?

Thanks
 
Probably, but your going to have to provide more information than. A good way to start is list the structure of the tables, and the structure of the final combined table.
 
As an example let's say the tables are:

table1
table2
table3
table4
table5

and the resulting table would be
table6

Thanks for the response
 
And do all the tables have the exact same fields?

If so, it would seem very simple, you just have 5 append queries to Table6.
 
What have you tried?
What were your results?
What are the structures of your tables with the field types?
Are the tables related?
Why do you want to combine them?
Why are they separate?

Duane
Hook'D on Access
MS Access MVP
 
i have experimented with a lot of VBA code with no results that fit the need.

The latest tries are with a Union query. Trouble is I can't get it to work with more than 2 tables and then create a table fom the result.

SELECT * From [table1]
UNION SELECT * From [Table2];

Thanks
 
I'm not sure why you don't provide more information about your tables and their structures or respond to the other questions we have asked [banghead]

"can't get it to work" doesn't say anything about your results that provides any way someone can do more than guess.

Duane
Hook'D on Access
MS Access MVP
 
we need something like this:

[tt]
Table1Name
Field1Name
Field2Name

Table2Name
Field1Name
Field2Name

Table3Name
Field1Name
Field2Name

Table4Name
Field1Name
Field2Name

Table5Name
Field1Name
Field2Name[/tt]

and indicate if any of the fields are related to fields in other tables...and if there are any Key fields, please indicate those.

Leslie
 
Thanks everyone. I was able to get something working last night. Using this format.

Select [Doc_ID], [Documentation],
Code:
FROM [Documentation Verification]

UNION ALL SELECT [Rec_ID], [Receiving], [Code] 
FROM [Receiving Verification];

UNION ALL SELECT [dim_ID], [Dimensions], [Code]
FROM [Dimensional Verification];

Then from here I have the option of using the "Make Table" query and build it against the Union Query.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top