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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a report or query from multiple tables

Status
Not open for further replies.

random260

Programmer
Mar 11, 2002
116
US
I Know there must be an easy way to do this... using Access from office 97

I have 3 tables - computers, periphs, and other. The tables list the computer equipment in 3 different offices. I have designed a report that lists all the computers, and sorts them by office (from the computer table). I want to include in this report all of the periphs and other equipment from the three ofices that is listed in the other 2 tables, and still have it all sorted by office. I assume that the easiest way to do this is to build the report from a query, but when I add more then one table to a query, I get nothing for output - aparently no matching records for whatever the query says. I guess what I need is someone to tell me how to build a query that will just list everything in all 3 tables, then I can pick and choose to build the report. I would like the query to list EVERYTHING from EVERY table, sorted like this

Office description user

mytown computer me
mytown computer him
mytown printer me
mytown scanner her
town2 computer him2
town2 computer her2
town3 computer him3
town3 printer him3

meaning that when I design my report, I DON'T want it to list all the data from the computer table by office, then all the data from the periph table by office, etc. - I want the report to have only 3 sections, one for each office. There must be a way to design a relationship or something that will let me do this. Help please!
 
If the query result is giving nothing it sound like either your linking field is not matching up or that you have placed criteria on the query that is excluding all data.

Check the common field between tables. If it is a text field, make sure the values in that field are the same for all tables. For instance, if it's 01 in one table it can't be entered as 1 in the other table.

To make your troubleshooting easier start with the link between two tables to make sure that is working, then bring in the third, and/or any criteria you wish to apply.
 
You need to get the data from the three tables into a single dynaset by using a Union Query. thereafter, you can sort in what ever way you want.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top