Field on report bound on sum field of sub report

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi everyone,

Need some help.

I have a report with a subreport and a field on the report that's bound to
the total field(sum) of the sub report.

The problem I have is that when there's no data in the sub report, the field
on the report gives #Error.

Is there a way I can make the field on the report show 0(zero) if there's no
data in the sub report.

I've tried IsNull([field]), IsError([field]) and IsEmpty([field]) in a IIf
statement but they don't work, any suggestions would be greatly appreciated.

TIA,

Martin.
 
Hi Martin,

You could try adding zero to the field value and see if that works,
otherwise, perhaps a replace statement may work?

HTH, Carl
 
Martin said:
I have a report with a subreport and a field on the report that's bound to
the total field(sum) of the sub report.

The problem I have is that when there's no data in the sub report, the field
on the report gives #Error.

Is there a way I can make the field on the report show 0(zero) if there's no
data in the sub report.

I've tried IsNull([field]), IsError([field]) and IsEmpty([field]) in a IIf
statement but they don't work, any suggestions would be greatly appreciated.


You need to use the subreport's HasData property for this.

=IIf(subreport.Report.HasData, subreport.Report.txttotal, 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

Back
Top