displaying the combined value of a subreport and a field

S

stevemenai

I am trying to display the combined value of a sub report and a field on a
report. It works fine as long as the subreport is returning a value.
However if the subreport does not return a value o get an error. I have
tried using the expression =IIf(isNull(subreport),value of field,value of
field + value of subreport) but i still get an error message when there is no
value. I have also tried Len(subreport)<1 and subreport like "" with no
luck. What should I test for???
 
O

Ofer Cohen

Try using the HasData to check if there are records in the sub report

=IIf(subreport.Report.HasData, subreport.Report.TextBoxName, 0)
 
O

Ofer Cohen

Try using the HasData to check if there are records in the sub report

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

Need to change the subreport to the name of the SubReport control in your
report.
Also the text box name
 

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