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

Multiple queries in report?

Status
Not open for further replies.

medic133

Technical User
Apr 7, 2002
86
US
I have a report which I think I want based on a query. This report displays different classes taught be different instructors. The format of the report that I want is the following:

Instructor1
Classinformation1
Classinformation2
Classinformation3

Instructor2
Classinformation4
Classinformation5

Instructor3
Classinformation6
Classinformation7
Classinformation8
Classinformation9

As you can see there are different numbers of classes for each instructor. I have written a simple select query which provides the information I want, I'm just having trouble getting the report to look the way that I want. When I place the query in the report this is the format that I get:

Instructor1 Classinformation1
Instructor1 Classinformation2
Instructor1 Classinformation3
Instructor2 Classinformation4
Instructor2 Classinformation5

...and so on.

I thought of using another query to list just the instructors but I don't know how to put two queries in one report except as subreports and I don't think that will allow the format that I want. I have a feeling this is an easy fix, but, any suggestions? Thanks in advance.
 
Using the report to sort is correct.

Go to View/ sorting & Grouping when you have the report open in Design view.

if Field/Expression select the field that contains the instructor details (instructor) and choose Group Header Yes.

You can also choose keep together whole group which will ensure the instructor and its details are kept on one page together wherever possible.

Now you have to copy the instructor fields that you currently have in the details next to the class details up into the intructor header on your report (should be just above the details area.

That should give you what you want.

You can also then play with the grouping and new page options to get the report to breaka at the correct spots.

I hope that solves it.
 
Absolutely perfect!! Quite some time ago I had seen this function, but really had no idea what it was good for. This will have other applications within this and other databases. Thanks for the great heads up!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top