Calculations on subreports and reports

A

Adam

I have a subreport on my report. I do a calculation on
the report with data from the subreport. Everything works
fine assuming there is some data in the subreport. When
there is no data, I recieve an #Error on the main report.
I understand why this is happening, I need to find a way
to prevent the error from appearing in the instances of no
data on the subreport. I tried to do a simple If
statement in the control box:

=IF("#Error", 0, {my calculation})

Obviously this didn't work.

Any ideas?

Thanks
 
M

Marshall Barton

Adam said:
I have a subreport on my report. I do a calculation on
the report with data from the subreport. Everything works
fine assuming there is some data in the subreport. When
there is no data, I recieve an #Error on the main report.
I understand why this is happening, I need to find a way
to prevent the error from appearing in the instances of no
data on the subreport. I tried to do a simple If
statement in the control box:

=IF("#Error", 0, {my calculation})

Try this kind of expression:

=IIf(subreport.Report.HasData, subreport.Report.textbox, 0)
 

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