#error subreports calculation

  • Thread starter Thread starter Sherry
  • Start date Start date
S

Sherry

I have created a report that contains several
subreports. Out of each subreport is a value that I use
in calculating totals on the main report. Sometimes one
or more of the subreport will not have any record in it
because of a query. When this happens my totals on my
main report gives me an error.

I need an if statement that will fill in a 0 value when
the subreport is missing.

Can anyone help me with this.

Thank You
Sherry
 
Test the HasData property of the report in the subreport control, e.g.:

=IIf([Sub1].[Report].[HasData], Nz([Sub1].[Report].[Text1], 0), 0)
 
Sherry said:
I have created a report that contains several
subreports. Out of each subreport is a value that I use
in calculating totals on the main report. Sometimes one
or more of the subreport will not have any record in it
because of a query. When this happens my totals on my
main report gives me an error.

I need an if statement that will fill in a 0 value when
the subreport is missing.

=IIf(subreport.Report.HasData, subreport.Report.totalbox,0)
 
Thank you so much, that worked!
Sherry
-----Original Message-----
Test the HasData property of the report in the subreport control, e.g.:

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

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have created a report that contains several
subreports. Out of each subreport is a value that I use
in calculating totals on the main report. Sometimes one
or more of the subreport will not have any record in it
because of a query. When this happens my totals on my
main report gives me an error.

I need an if statement that will fill in a 0 value when
the subreport is missing.

Can anyone help me with this.

Thank You
Sherry


.
 
Back
Top