This is a total of both Some of the sub reports
have a total which I am try to sum. I have
used NZ but the fact is if there is no record
to display there is no zero
The Calculated Control without information should be Null. The Null should
be replaced by a zero by the NZ function. But, I suspect, in your case, the
Report and Subreport Control may not exist and therefore the control itself
may not exist... not "null" (indeterminate) but "nonexistent", and that's
what is causing the problem.
I put a text box in the page footer section
and did a calcution something like this
= subrep1.tot_min + subrep2.tot_add_ded + and etc.
The Page Footer is not a logical place from which toexpect to access totals
in the footer of SubReports, of which there could (even if not in _your_
Report) be many copies on that page. It doesn't total the totals of all the
Report Footers of the Reports imbedded in all the Subreports.
A similar calculation as the Control Source in Section where the Subreport
Controls actually appear should work... it, however, will itself be a
Calculated Field and, for that reason, you could not Sum it in the Page
Footer.
In the text box where I am doing the totals is says #error
I can understand, from your other explanations. That is just an indication
that Access cannot perform the calculation, or cannot find the value,
specified as Control Source.
Actually the name feild is Stage_name. I
do have one name for a feild that is called
name but it just a simple feild use to story
quess what, the name
Avoiding reserved words as Field names is a good habit to develop. They do
not always cause a problem, but when they do, it can be difficult to
diagnose.
The easiest solution is to display the sum of the totals in a context where
Access can calculate it. Otherwise, you may have to calculate the number you
want, using VBA to save the sum in a variable, in an event of the Section
where it is available. You will need to take care not to calculate it more
than once, because those events can fire more than once per record,
particularly if you are paging back and forth in Preview.
Larry Linson
Microsoft Access MVP