Running sum in group header

A

Access User

I'm trying to print totals in a group header section on a report, but I'm
not getting the results I'm looking for. I have two hidden counters in the
StudentID_Header_Section--one keeping a running sum over the group, and the
other keeping a running sum over all--but I want to print the group sum in a
previous header. The grand total is correct, but the total printing in the
previous group header is incorrect. What am I doing wrong?

Here's the report design:

School_Name_Header_Section
[School_Name] [Total_Students]
ControlSource:
=[RunningSumOverGroup]

StudentID_Header_Section
[RunningSumOverGroup] [RunningSumOverAll]
ControlSource: =1 ControlSource: =1

Report_Footer_Section
[Grand_Total_Students]
ControlSource:
=[RunningSumOverAll]


Here's the report output:

School_A Total Students: 1
Student 1

School_B Total Students: 1
Student 2
Student 3

School_C Total Students: 1
Student 4

Grand Total Students: 4

Thanks for any help,
Alec
 
M

Marshall Barton

Access said:
I'm trying to print totals in a group header section on a report, but I'm
not getting the results I'm looking for. I have two hidden counters in the
StudentID_Header_Section--one keeping a running sum over the group, and the
other keeping a running sum over all--but I want to print the group sum in a
previous header. The grand total is correct, but the total printing in the
previous group header is incorrect. What am I doing wrong?

Here's the report design:

School_Name_Header_Section
[School_Name] [Total_Students]
ControlSource:
=[RunningSumOverGroup]

StudentID_Header_Section
[RunningSumOverGroup] [RunningSumOverAll]
ControlSource: =1 ControlSource: =1

Report_Footer_Section
[Grand_Total_Students]
ControlSource:
=[RunningSumOverAll]


Here's the report output:

School_A Total Students: 1
Student 1

School_B Total Students: 1
Student 2
Student 3

School_C Total Students: 1
Student 4

Grand Total Students: 4


I think they change that so it would work in A2003. I have
no idea how they could display a value that has yet to be
calculated so my confidence level in its reliability is low.

OTOH, I don't see why you would need a running sum just to
count the records. Can't you use the report and group
header text box expression =Count(*) to do what you want?
 
A

Access User

Thanks for the reply. Actually, there's a bit I didn't mention about the
fact that there could be multiple detail records for a student (e.g. one
student could be in multiple classes) that would throw off a count of unique
students for each school.

Looks like I'll just stick the subtotal at the end of the group and live
with that. Thanks again for the help.

Alec

Marshall Barton said:
Access said:
I'm trying to print totals in a group header section on a report, but I'm
not getting the results I'm looking for. I have two hidden counters in
the
StudentID_Header_Section--one keeping a running sum over the group, and
the
other keeping a running sum over all--but I want to print the group sum in
a
previous header. The grand total is correct, but the total printing in
the
previous group header is incorrect. What am I doing wrong?

Here's the report design:

School_Name_Header_Section
[School_Name] [Total_Students]
ControlSource:
=[RunningSumOverGroup]

StudentID_Header_Section
[RunningSumOverGroup] [RunningSumOverAll]
ControlSource: =1 ControlSource: =1

Report_Footer_Section

[Grand_Total_Students]
ControlSource:
=[RunningSumOverAll]


Here's the report output:

School_A Total Students: 1
Student 1

School_B Total Students: 1
Student 2
Student 3

School_C Total Students: 1
Student 4

Grand Total Students: 4


I think they change that so it would work in A2003. I have
no idea how they could display a value that has yet to be
calculated so my confidence level in its reliability is low.

OTOH, I don't see why you would need a running sum just to
count the records. Can't you use the report and group
header text box expression =Count(*) to do what you want?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top