Problem with Sum on subreport

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
I have a report containing a subreport. I use the Sum function in a
text box on the subreport to total some values. I then report the total on
the main form by refering to this box.
This all works fine, unless there are no records in the subform
(which happens with some regularity). What I need is a way to return 0 if
there are no records. I tried wrapping the reference to the subform's text
box in an Nz() call, but to no avail.
Can someone show me the way?

- Max
 
Test the HasData property of the subreport.

Assuming a subreport named "Sub1":

=IIf([Sub1].[Report].[HasData], Nz([Sub1].[Report].[Text1], 0), 0)
 
Test the HasData property of the subreport.

Assuming a subreport named "Sub1":

=IIf([Sub1].[Report].[HasData], Nz([Sub1].[Report].[Text1], 0), 0)

Geez, I didn't know there was one (obviously). Thanks, Allen.

- Max
 

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