473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Multi table/query report

I am trying to create a report using multiple tables.

The first table has Employee info in it (name and id's).

the next three tables have employee info for training, test, scores, etc.

I am having trouble in how to set up a report to capture all the of the
tables for one specific employee and for a date range.

If I create the report based on the Employee info in table 1 and then create
subreports I do not know how to link the dates of the training, tests, and
scores since these do not exist in table 1. I tried creating Training as a
subreport and then Test as a subreport within the Training subreport and link
the user id and dates, but I rcvd an error and Access closed.

Can someone give me some ideas on how to create this report?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 2 '07 #1
5 2803
ladybug via AccessMonster.com wrote:
I am trying to create a report using multiple tables.

The first table has Employee info in it (name and id's).

the next three tables have employee info for training, test, scores, etc.

I am having trouble in how to set up a report to capture all the of the
tables for one specific employee and for a date range.

If I create the report based on the Employee info in table 1 and then create
subreports I do not know how to link the dates of the training, tests, and
scores since these do not exist in table 1. I tried creating Training as a
subreport and then Test as a subreport within the Training subreport and link
the user id and dates, but I rcvd an error and Access closed.

Can someone give me some ideas on how to create this report?
Your link would be the EmployeeID most likely. IOW, have the employeeID
in each sub report (most likely visible = False). If you right click on
each subreport and select Properties and click the data tab. In the
LinkChild/Master set to the EmpID.
Aug 2 '07 #2
I know how to link the subreports together by Employee id, but I don't know
how to do link the date ranges together.
Salad wrote:
>I am trying to create a report using multiple tables.
[quoted text clipped - 12 lines]
>>
Can someone give me some ideas on how to create this report?

Your link would be the EmployeeID most likely. IOW, have the employeeID
in each sub report (most likely visible = False). If you right click on
each subreport and select Properties and click the data tab. In the
LinkChild/Master set to the EmpID.
--
Message posted via http://www.accessmonster.com

Aug 2 '07 #3
ladybug via AccessMonster.com wrote:
I know how to link the subreports together by Employee id, but I don't know
how to do link the date ranges together.
Salad wrote:
>>>I am trying to create a report using multiple tables.

[quoted text clipped - 12 lines]
>>>Can someone give me some ideas on how to create this report?

Your link would be the EmployeeID most likely. IOW, have the employeeID
in each sub report (most likely visible = False). If you right click on
each subreport and select Properties and click the data tab. In the
LinkChild/Master set to the EmpID.

You could put
Between [Enter From Date] To [Enter To Date] if you aren't calling the
report for a form.

If calling from a form, enter
Between Forms!RptForm!FromDate and Forms!RptForm!FromDate
in the recordsource of the subreports or make the recordsource a query
that has criteria like the above.
Aug 2 '07 #4
I have that as the criteria for the date as well, but I do not know how to
link the different queries together by date without it prompting me for the
date range 4 times. I might need to be more specific.

First table:
Customer ID First Name Last Name
1111 John Smith
2222 Joe Miller
3333 Sally Davis
Second table:
Customer ID Training Date Training Description
1111 07/01/07 How to Tie Your shoe
1111 07/02/07 Learning the Alphabet
2222 07/02/07 Learning the Alphabet
Third table:
Customer ID Test Date Test Description
1111 07/10/07 Presidents
2222 07/10/07 Presidents
1111 07/15/07 Countries
Ok, now I want a report that the user can enter in the employee id and date
range and the information for only that employee within that date range is
returned. So for example, if I entered in 1111 for employee id and 07/01/07
as begin date and 07/10/07 as end date in the criteria I want returned
Employee ID: 1111 First Name: John Last Name: Smith

Training
07/01/07 How to Tie Your shoe
07/02/07 Learning the Alphabet

Tests
07/10/07 Presidents

How do I link the queries together to get this for a report?
Thank you so much for trying to help me. I appreciate any assistance!!
Salad wrote:
>I know how to link the subreports together by Employee id, but I don't know
how to do link the date ranges together.
[quoted text clipped - 9 lines]
>>>each subreport and select Properties and click the data tab. In the
LinkChild/Master set to the EmpID.

You could put
Between [Enter From Date] To [Enter To Date] if you aren't calling the
report for a form.

If calling from a form, enter
Between Forms!RptForm!FromDate and Forms!RptForm!FromDate
in the recordsource of the subreports or make the recordsource a query
that has criteria like the above.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 2 '07 #5
On Aug 2, 6:01 pm, "ladybug via AccessMonster.com" <u21071@uwewrote:
I have that as the criteria for the date as well, but I do not know how to
link the different queries together by date without it prompting me for the
date range 4 times. I might need to be more specific.

First table:
Customer ID First Name Last Name
1111 John Smith
2222 Joe Miller
3333 Sally Davis

Second table:
Customer ID Training Date Training Description
1111 07/01/07 How to Tie Your shoe
1111 07/02/07 Learning the Alphabet
2222 07/02/07 Learning the Alphabet

Third table:
Customer ID Test Date Test Description
1111 07/10/07 Presidents
2222 07/10/07 Presidents
1111 07/15/07 Countries

Ok, now I want a report that the user can enter in the employee id and date
range and the information for only that employee within that date range is
returned. So for example, if I entered in 1111 for employee id and 07/01/07
as begin date and 07/10/07 as end date in the criteria I want returned

Employee ID: 1111 First Name: John Last Name: Smith

Training
07/01/07 How to Tie Your shoe
07/02/07 Learning the Alphabet

Tests
07/10/07 Presidents
If you have control over the tables and their structure, I would
combine the information from your second and third tables. This
eliminates the UNION and makes the SQL much easier if a third category
is added. Then I might do something like:

tblCustomers
CustomerID AutoNumber (Primary Key)
CustomerFirstName Text
CustomerLastName Text
CustomerID CustomerFirstName CustomerLastName
1111 John Smith
2222 Joe Miller
3333 Sally Davis

tblTestTraining
TTID AutoNumber (Primary Key)
CustomerID Long (Foreign Key)
TrainingTestDate Date/Time
TrainingTestDescription Text
TestTraining Text
TTID CustomerID TrainingTestDate TrainingTestDescription TestTraining
1 1111 07/01/07 How to Tie Your Shoe Training
2 1111 07/02/07 Learning the Alphabet Training
3 2222 07/02/07 Learning the Alphabet Training
4 1111 07/10/07 Presidents Tests
5 2222 07/10/07 Presidents Tests
6 1111 07/15/07 Countries Tests

qryTestTraining:
SELECT tblCustomers.CustomerID, CustomerFirstName, CustomerLastName,
TrainingTestDate, tblTestTraining.TrainingTestDescription,
TestOrTraining FROM tblCustomers INNER JOIN tblTestTraining ON
tblCustomers.CustomerID = tblTestTraining.CustomerID;

!qryTestTraining:
CustomerID CustomerFirstName CustomerLastName TrainingTestDate
TrainingTestDescription TestOrTraining
1111 John Smith 7/1/2007 How to Tie Your Shoe Training
1111 John Smith 7/2/2007 Learning the Alphabet Training
1111 John Smith 7/10/2007 Presidents Tests
1111 John Smith 7/15/2007 Countries Tests
2222 Joe Miller 7/2/2007 Learning the Alphabet Training
2222 Joe Miller 7/10/2007 Presidents Tests

rptTestTraining:
Report Sorting and Grouping: CustomerID Ascending, TestOrTraining
Descending

CustomerIDHeader: CustomerID, CustomerFirstName, CustomerLastName
TestOrTrainingHeader: TestOrTraining, Heading Labels
Detail: TrainingTestDate, TrainingTestDescription

!rptTestTraining:
1111 John Smith
Training
7/2/2007 Learning the Alphabet
7/1/2007 Howto Tie Your Shoe
Test
7/15/2007 Countries
7/10/2007 Presidents
2222 Joe Miller
Training
7/2/2007 Learning the Alphabet
Test
7/10/2007 Presidents

Note: Even though the TrainingTestDescription field contained "How to
Tie Your Shoe," the A97 report displayed "Howto Tie Your Shoe." Maybe
Access is trying too hard to be helpful. I am working on a similar
problem tonight where I have to keep track of safety training for
employee badges (e.g., HiLo training or Ladder Safety), plus
certification training such as Weld or Laser Inspection. Anyone
operating equipment can be stopped to see if their safety badge allows
them to use that equipment. I left the date range specification out
of the example. It can be placed in the SQL (using PARAMETERS, WHERE,
BETWEEN, etc.) or you can use Salad's dynamic string Filter idea.
Remember to put non-unique indices on tblTestTraining.TrainingTestDate
and on tblTestTraining.CustomerID to aid in filtering and joining.

James A. Fortune
CD********@FortuneJames.com

Aug 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: eliffman | last post by:
I get the following error when trying to run a report: Multi-level GROUP BY clause is not allowed in a subquery. (Error 3612) The report's recordsource is a query based on a single table....
3
by: syounger | last post by:
Hi. I have a report in Access 2000 that is based on selection made from a series of interdependent list boxes. The boxes I have right now are Source, Table, Column, Date. The user chooses Source...
1
by: Tim Marshall | last post by:
A2003. I am getting this error message when I try to set a report's recordsource to an SQL statement or a saved querydef that uses sub-queries. I've debug.printed the SQL, and run it as a stand...
1
by: barb | last post by:
We are trying to build a multi level BOM report. The problem we are having is in designing the report so that the spacing for each level does not show up on the report when there is no information....
7
by: 663scott | last post by:
Hi I am pretty new to ACCESS. I have created some small databases previously. I need to run a simple query searching for a USERNAME which will gather information from five to ten tables containing...
3
by: gihope | last post by:
Can anyone tell me why I am not allowed to bind a two or multi dimensional array to GridView and possibly suggest how they would deal with similar scenarios? The array is simply a two dimensional...
1
by: mskapek | last post by:
I need some advise on how to best create an Access 2002 report from multiple "total" queries, each which result in 3- 5 values that I need displayed on my report. Most of the queries do simple...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
12
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.