Combining multiple tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I have 300 + tables with identical fields in them. I need to combine all of
these tables into one table and add a field that identifies the records based
off of the table name.

Example:

Table1 fields:
Name
Date
Age
Height

Table2 fields:
Name
Date
Age
Height

The new table would combine these two tables (as well as the other 300) and
create a new main table:

NewTable fields:
ID (this would be Table1, Table2, Table3, etc)
Name
Date
Age
Height

Is there a way to do this with a script that captures the name of the table
and then appends to the new table or do I have to run 300 seperate append
tables?

Thanks for any help you can give...
 
Loop through the TableDefs collection, building an Append query statement
(string) for each one, and Execute it.

You will need to skip the target table, and the hidden system tables.
 
Thanks Allen.

Im new to Access and not sure how to do that. Do you have an example of how
to do this?
 
Back
Top