Query from Multiple tables

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

Guest

I have multiple tables that have the same fields. For instance, I have five
tables that have the following fields: firstName, LastName, TelephoneNumber.
I would like to create a query that has will list all of the records in the
five tables with the column headings firstName, LastNmae, TelephoneNumber. Is
there a way to do this?

Thanks for your help.
 
Create a union query:
SELECT FirstName, LastName, TelephoneNumber
FROM tableA
UNION
SELECT FirstName, LastName, TelephoneNumber
FROM tableB
UNION
SELECT FirstName, LastName, TelephoneNumber
FROM tableC
UNION
SELECT FirstName, LastName, TelephoneNumber
FROM tableD
UNION ...;
 
Thanks Duane!

That works great. But I need one more thing!

I cannot edit the data from the query. Is it possible to edit fields?

Thanks,

Ed
 
You can't edit records in a union query.

Is there a good reason why you have multiple similar tables?
 
Well it's not a good reason, but it is a reason! The tables are really linked
tables to seperate databases. I need to view the combined data, edit the data
and then return the updated tables. Any ideas on how I could do this?

Thanks for your help!
 
You could set a double-click event of a record in your union query (bound to
a form) that would open a form with a single editable record.
 
Back
Top