adding subreport values on main report

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
 
M

Marshall Barton

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
 

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