Sum of Amounts in a report

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

Guest

I have a report/sub report. I would like to add the sum
of the report and the sub report and display it on the
report. Is this possible? If yes, how?

Thanks
 
I have a report/sub report. I would like to add the sum
of the report and the sub report and display it on the
report. Is this possible? If yes, how?

Does the subreport appear more than once (e.g. in each
detail)?

If not, then you can use a text box with a simple expression
like:
=Sum(field) + subreport.Report.textbox

field
is the name of the field in the main report's record source
table/query that you want to sum.

subreport
is the name of the subreport control on the main report.

textbox
is the name of the text box in the subreport's footer that
you want to add to the main report's total.
 
The sub report appears in each detail.
-----Original Message-----


Does the subreport appear more than once (e.g. in each
detail)?

If not, then you can use a text box with a simple expression
like:
=Sum(field) + subreport.Report.textbox

field
is the name of the field in the main report's record source
table/query that you want to sum.

subreport
is the name of the subreport control on the main report.

textbox
is the name of the text box in the subreport's footer that
you want to add to the main report's total.
 
In that case, add a text box named txtRunSubTot to the
detail section. Set its control source expression to:
=subreport.Report.textbox
and set its RunningSum property to Over All.

Note that is there's any chance that the subreport might not
have any data, the expression should be:
=IIf(subreport.Report.HasData, subreport.Report.textbox, 0)

The grand total text box in the main report's footer would
then be:
=Sum(field) + txtRunSubTot
 
Back
Top