Summing fields on a subreport

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report and a subreport. I would like to sum a field on the subreport
and put it in the Grand Total area of the main report. I have tried the
following and it doesn't work.

=Sum([Reports]![rptSumDowntime]![srptSumDowntime].[Form].[SumOfMechanicalDowntime])

Mainform: rptSumDowntime
Subreport: srptSumDowntime
Field I want to sum on the subreport: SumOf MechanicalDowntime

Any help would be appreciated.
 
SHIPP said:
I have a report and a subreport. I would like to sum a field on the subreport
and put it in the Grand Total area of the main report. I have tried the
following and it doesn't work.

=Sum([Reports]![rptSumDowntime]![srptSumDowntime].[Form].[SumOfMechanicalDowntime])

Mainform: rptSumDowntime
Subreport: srptSumDowntime
Field I want to sum on the subreport: SumOf MechanicalDowntime


The aggregate functions (Count, Sum, etc) only operate on
fields in the (sub)report's record source query. They are
unaware of controls on the (sub)report.

In this case, you need to calculate the subreport total in
the subreport's footer section using a text box, which I
think you already have in SumOfMechanicalDowntime.

Then you need to add a text box (let's name it txtRunTotal)
to the main report section that contains the subreport. Set
its control source expression to
=srptSumDowntime.Report.SumOfMechanicalDowntime
and its RunningSum property to Over All.

The main report's footer text box can then display the grand
total by simply using the expression =txtRunTotal
 
Back
Top