473,699 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.c om
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 2 '07 #1
5 2824
ladybug via AccessMonster.c om 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.c om 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!F romDate and Forms!RptForm!F romDate
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!F romDate and Forms!RptForm!F romDate
in the recordsource of the subreports or make the recordsource a query
that has criteria like the above.
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 2 '07 #5
On Aug 2, 6:01 pm, "ladybug via AccessMonster.c om" <u21071@uwewrot e:
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)
CustomerFirstNa me Text
CustomerLastNam e Text
CustomerID CustomerFirstNa me CustomerLastNam e
1111 John Smith
2222 Joe Miller
3333 Sally Davis

tblTestTraining
TTID AutoNumber (Primary Key)
CustomerID Long (Foreign Key)
TrainingTestDat e Date/Time
TrainingTestDes cription Text
TestTraining Text
TTID CustomerID TrainingTestDat e TrainingTestDes cription 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.Cu stomerID, CustomerFirstNa me, CustomerLastNam e,
TrainingTestDat e, tblTestTraining .TrainingTestDe scription,
TestOrTraining FROM tblCustomers INNER JOIN tblTestTraining ON
tblCustomers.Cu stomerID = tblTestTraining .CustomerID;

!qryTestTrainin g:
CustomerID CustomerFirstNa me CustomerLastNam e TrainingTestDat e
TrainingTestDes cription 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

CustomerIDHeade r: CustomerID, CustomerFirstNa me, CustomerLastNam e
TestOrTrainingH eader: TestOrTraining, Heading Labels
Detail: TrainingTestDat e, TrainingTestDes cription

!rptTestTrainin g:
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 TrainingTestDes cription 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 .TrainingTestDa te
and on tblTestTraining .CustomerID to aid in filtering and joining.

James A. Fortune
CD********@Fort uneJames.com

Aug 3 '07 #6

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

Similar topics

4
3749
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. However, one of the fields in the query is a subquery. This field is also used in the calculations for a few other fields in the query. I'm able to run the report with no group levels. But the addition of even one group level causes the error.
3
2884
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 first, then the Table list box populates only tables from that source. Once a table is chosen, only the columns for that table appear in the Column list box. In the date box, the only dates that appear are those that are stored against the...
1
7195
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 alone query, as a rowsource for a list box and as a recordsource for a form. There's no problem. I'm only encountering this in reports. As a stop gap, I'm going to use a form for a printe report, bvut I wonder if anyone has encountered...
1
2484
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. Can this be handled with vb code or some kind of special query or table structure? The report right now is based on a recursive query, but in report design each level has line space. So when it prints and there are no parts there are spaces. We...
7
2296
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 seperate bits of information and combine them into a report. The primary key on all of the tables is the username. AS AN EXAMPLE: TABLE 1 USERNAME DATE JOINED
3
18055
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 monthly volume array: Extract from Report class: // Query all Messages Sent for a Given Month public string qVolumeByMonth() { string volumeByMonth = new string;
1
2039
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 counts based on 3 different tables. For instance, I need to count the number of new clients enrolled in a program for a given month or year-to-date grouped by 4 different referral sources (based on the start date for the client). Then I need to count...
17
3130
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 that I am using Allen Browne's multi-select list box for a report as a guide. I should also note that my access skills are not the best so I may need some explaining on certain things. First let me give some background on the database: I have a...
12
4034
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 not several, to report using this code i found - Private Sub cmdPreview_Click()
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7745
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.