SUBREPORTS' TOTALS' ERRORS

  • Thread starter Thread starter Faraz Ahmed Qureshi
  • Start date Start date
F

Faraz Ahmed Qureshi

In a worksheet format subreport's footer I have inserted a formula in a TXTBX
field as
=NZ(Sum([Amt]),0)
so as to present the total. Now, that I have my Main Report's field GTXTBX
field set as
=NZ([SubreportName].[TXTBOX],0)
a case where there is no correponding entry in the subreport GTXTBX results
in presenting #Error.
How 2 avoid the same and present 0, where there is no record matching for
the Main Report???
 
Try:
=Sum(Nz([Amt],0))

The Sum() function ignores Nulls already. I looked at one of my
reports with a hidden textbox called txtSubTotal (simplified for
illustration purposes).

txtSubTotal.ControlSource:

=[rptSubWork].[Report]![txtSumOutstandingBalance]

txtSubOutstandingBalance.ControlSource:

=Sum([OutstandingBalance]) + IIf(Reports("rptWork").[Controls]
("rptSubWork").[Report].[HasData],Nz([txtSubTotal].[Value]),0)

That way the outstanding balance on the report gets added to the
outstanding balance from the subreport, provided those records exist.
I use the main report to show jobs that have shipped and have been
invoiced. I use the subreport to show jobs that have shipped, yet
have not been invoiced. The subreport columns are shown after the
normal columns in the report footer as a very short control that is
allowed to grow, with the totals immediately below the subreport.

James A. Fortune
(e-mail address removed)

The cue toss in "The Hustler" was not a random thing. The cue had to
have a certain amount of running english and hit the rail at a certain
point from along a certain line so that it could be determined whether
the table is playing long or short, and by how much. Such calibration
is necessary for adjustments to various diamond systems used for
banking and kicking.
 
Faraz Ahmed Qureshi said:
In a worksheet format subreport's footer I have inserted a formula in a
TXTBX
field as
=NZ(Sum([Amt]),0)
so as to present the total. Now, that I have my Main Report's field GTXTBX
field set as
=NZ([SubreportName].[TXTBOX],0)
a case where there is no correponding entry in the subreport GTXTBX
results
in presenting #Error.
How 2 avoid the same and present 0, where there is no record matching for
the Main Report???
 
Back
Top