Subreports / Grouping

rube

Registered User.
Local time
Today, 13:24
Joined
Jun 21, 2003
Messages
76
I have a Main Table for Contacts, on the form for my Contact, I have subforms to keep track of Classes Taken, and Activities, (etc.) which are tables linked by a the Contact Primary Key.

I need a Report that will pull the Classes and Activities info. I know I can put the subreports on a Main Report, grouped by the Class/Activity/Etc., but is there a way to re-group it by the Contact which is more important.

Also, can I hide/shrink a subform without data on the Main Form.

Any help is appreciated.
 
Point1: Create a query with the Contacts table, Classes Taken table etc(all the tables that you want data from. Next create a query using the query wizard and select the query and all the fields you want. The wizard will ask you for groupings and this is where you select contact(pk) and then any other grouping. If you wish to just group by contact and you have loads of data from different tables then create a report based on a simple select query using contact table. Then create all the sub reports for all the other data and put it in the detail section.

In order to hide the sub form you can use something like

On_Load mainform

if me.subform.recordcount=0 then
me.subform.visible=false
end if.

If u are still stuck zip up your db and we can look at it.
 
Grouping

Mark,
Thanks for the reply. I left out an important piece of information, I apologize, the reason I went to separate queries, was when a Contact did not have a Class, Activity, etc. no records would show, as long as there was a Class and Activity and ..., it would then show.

I included the db, got rid of everything but the Contact and two subtables, and only have two records.

------------------------------------------------------------------------------
John Doe has an Activity and a Class, the "qryInclusive" query pulls fine.

James Smith has a Class, but no Activity, his Records do not show.
-------------------------------------------------------------------------------

I know there must be a better way than the way I am doing, or an important piece I am leaving out.

Thanks for the help,

Rube
 
rube,

The database you posted is in "unrecognized format" so I can't
open it.

I think the problem with your query is this:

You have two tables A (on the left) and B (on the right) that
are joined by a line. Right-Click on the line and choose
join properties. You want ALL records from A and only those
from B where they match.

Wayne
 
Hit the Mark

Once again, hit the nail on the head! I do appreciate the time you have spent posting a reply to this and other posts.

Thanks again Wayne,

Rube
 

Users who are viewing this thread

Back
Top Bottom