In report, how to have a count return something other than null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subreport that holds a count of names at the end of the report that
I want to reference in the main report to add it. My problem is that
sometimes this subreport ends up being null - there aren't always entries.
Can i have the count give a value of zero if it is null so it doesn't give me
that #Error and screw up my counts in the main form? I tried nz, and iif
statment, etc but can't seem to make anything work.

Thanks!
 
When there are no records in the subreport, nothing shows, and so trying to
refer to the non-existent text box generates #Error.

To avoid that, test the HasData property of the report in the subreport
control:
=IIf([Sub1].[Report].[HasData], Nz([Sub1].[Report]![Text0],0), 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