Counting records in subreports

Timberwolf

Registered User.
Local time
Today, 05:08
Joined
Dec 15, 2000
Messages
33
I have a report that contains five subreports. In each subreport I have created a field that contains the record count for the subreport. In each subreport, this field is called "Count."

I can't quite figure out how to add a field to the main form that will add together the "Count" fields from all of the subforms.

Thanks.
 
Hi Timberwolf

First let me say that I think it is probably better to change the name of your field from Count. "Count" is a function within Access, so like Date, Time, Now, Name etc it is probably better to avoid calling a field just this - but you could always call it txtCount.

If you have five subreports I would be tempted to call this field by a different name each time (nothing all that startling, just txtCount1, txtCount2 etc). However, it is unlikely that you will simply be able to add them all together in a txtOverallCount field as the data for each count text box within each subreport is being calculated at the same time as the overall count is trying to add the five calculated fields together.

So it might be better to reference back to what each subreport is counting:

=Count(Me!frmSubReport1!CustomerID)+Count(Me!frmSubReport2!CustomerID)+Count(Me!frmSubReport3!CustomerID) ... and so on.

See if that works (I haven't tried it, but I feel it ought to).

HTH

Rich Gorvin
 

Users who are viewing this thread

Back
Top Bottom