adding subreport values on main report

  • Thread starter Thread starter Miranda
  • Start date Start date
M

Miranda

hi guys,

i've got a report with 5 subreports which are arranged according to date. i
need to add up the subtotals from all of the subreports and put this on the
main report....i know how to do this i think...something like

= [subreport name].Report![control] + ..... etc

however, for a particular date there can be anywhere from 0 to 5 subreports
being displayed depending on what applies to that date. When i add up the
values, i then get #error. How can i get around this???

Thanks A LOT!

miranda
 
Miranda said:
i've got a report with 5 subreports which are arranged according to date. i
need to add up the subtotals from all of the subreports and put this on the
main report....i know how to do this i think...something like

= [subreport name].Report![control] + ..... etc

however, for a particular date there can be anywhere from 0 to 5 subreports
being displayed depending on what applies to that date. When i add up the
values, i then get #error. How can i get around this???

Any subreport that has zero records will not have the values
to reference and that's why you get #Error. You can check
for this condition with the HasData property.

Change you expression to this:

=IIf([subreport name].Report.HasData, [subreport
name].Report![control], 0) + ..... etc
 
Back
Top