SUBREPORTS' TOTALS' ERRORS

  • Thread starter Faraz Ahmed Qureshi
  • 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???
 
J

James A. Fortune

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.
 
D

De Jager

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???
 

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

Top