Three things to check:
(1) Is DailyCommPaymentsSubreport, DailyProgPaymentsSubreport, and
DailyCompPaymentsSubreport the correct names of the subreport controls on
the report? These names in the expression must be those of the subreport
control, which may or may not be the name of the source object for those
controls. If they're not the correct names, change them.
(2) If they are the correct names (and assuming that the control names on
the subreports are correct), then change the expression to this:
=IIf(IsError(DailyCommPaymentsSubreport.Report![comm
total]),0,DailyCommPaymentsSubreport.Report![comm
total])+IIf(IsError(DailyProgPaymentsSubreport.Report![prog total]), 0,
DailyProgPaymentsSubreport.Report![prog
total])+IIf(IsError(DailyCompPaymentsSubreport.Report![comp
total]),0,DailyCompPaymentsSubreport.Report![comp total])
(3) Put three temporary textboxes on the main report. Set the control source
of each to point to one of the three subreports' textbox. Let's see if all
are erroring, no matter whether the subreport has data or not, or if just
some.
--
Ken Snell
<MS ACCESS MVP>
rachael said:
It is possible that one or more of the sub reports will have no data,
which
is what causes the error, but unfortunately the below expression didn't
fix
the problem. Any other ideas?
Ken Snell said:
Is it possible for any of these subreports to have no data? if yes, then
there is no control in that subreport for the expression to read, and
that
will cause an error, which will propogate through the calculation.
Assuming that this is the problem, try this:
=IIf(DailyCommPaymentsSubreport.Report.HasData,DailyCommPaymentsSubreport.Report![comm
total],0)+IIf(DailyProgPaymentsSubreport.Report.HasData,DailyProgPaymentsSubreport.Report![prog
total],
0)+IIf(DailyCompPaymentsSubreport.Report.HasData,DailyCompPaymentsSubreport.Report![comp
total],0)
--
Ken Snell
<MS ACCESS MVP>
rachael said:
The subreports look at the three different types of payments received
in a
single day, and the main report then looks to combine the three reports
to
produce a daily figure.
Report total is
=DailyCommPaymentsSubreport.Report![comm
total]+DailyProgPaymentsSubreport.Report![prog
total]+DailyCompPaymentsSubreport.Report![comp total]
:
A zero total? Or a Null total? or no records in the subreport at all?
Tell us more info about the subreports' contents, and the expressions
that
you're using?
--
Ken Snell
<MS ACCESS MVP>
I have a report which includes 3 sub reports, each with a total. I
have
then
added these 3 totals to give a grand total. However, if one of the
sub
reports have a zero total, the report total comes up as an error. Is
there
a
way to stop this happening?