Calculate a sum of subreports in main report

  • Thread starter Thread starter mbudgen
  • Start date Start date
M

mbudgen

I am having difficulty with summing the total of three calculated fields from
several sub reports in a main report. I have been reading the solutions to
creating text boxes (Visibility set to No) and summing overall. This appears
to be working fine within the sub report but when I try and copy the
calculated value into a text box in the main report, I seem to only get the
first value attibuted to the text box in one of my the sub reports.

Sub Report Names
subreport_details_new_invoice
subreport_MSG_Expenses
subreport_MSG_Disbursements

Name of Text Boxes in Subreports
RunningSum - in subreport_details_new_invoice
AccessTotalsSubtotal1 - in subreport_MSG_Expenses
DisbursementTotalGrandTotalSum - in subreport_MSG_Disbursements

I have created 3 text boxes in the main report as follows:

Text113
=IIf([subreport_details_new_invoice].[Report].[HasData],[subreport_details_new_invoice].[Report].[RunningSum],0)

Text109
=IIf([subreport_msg_expenses].[Report].[HasData],[subreport_msg_expenses].[Report].[AccessTotalsSubtotal1],0)

Text111
=IIf([subreport_msg_disbursements].[Report].[HasData],[subreport_msg_disbursements].[Report].[DisbursementTotalGrandTotalSum],0)

The values for Text 109 and Text 111 seem to work correctly. The value for
Text113 seems to take on the first value (prior to the summing over all) in
the subreport and does not take the cumulative total. Any help would be most
appreciated. I am new to access to please forgive me if I have missed any
crucial information.

Thanks
 
mbudgen said:
I am having difficulty with summing the total of three calculated fields from
several sub reports in a main report. I have been reading the solutions to
creating text boxes (Visibility set to No) and summing overall. This appears
to be working fine within the sub report but when I try and copy the
calculated value into a text box in the main report, I seem to only get the
first value attibuted to the text box in one of my the sub reports.

Sub Report Names
subreport_details_new_invoice
subreport_MSG_Expenses
subreport_MSG_Disbursements

Name of Text Boxes in Subreports
RunningSum - in subreport_details_new_invoice
AccessTotalsSubtotal1 - in subreport_MSG_Expenses
DisbursementTotalGrandTotalSum - in subreport_MSG_Disbursements

I have created 3 text boxes in the main report as follows:

Text113
=IIf([subreport_details_new_invoice].[Report].[HasData],[subreport_details_new_invoice].[Report].[RunningSum],0)

Text109
=IIf([subreport_msg_expenses].[Report].[HasData],[subreport_msg_expenses].[Report].[AccessTotalsSubtotal1],0)

Text111
=IIf([subreport_msg_disbursements].[Report].[HasData],[subreport_msg_disbursements].[Report].[DisbursementTotalGrandTotalSum],0)

The values for Text 109 and Text 111 seem to work correctly. The value for
Text113 seems to take on the first value (prior to the summing over all) in
the subreport and does not take the cumulative total.


When a main report text box refers to a subreport value, it
needs to reference the subreport total that is normally in
the subreport's report header or footer section. The result
you are seeing implies that the main report is referencing
the running sum text box in the detail section.
 
Back
Top