Last page wrong

  • Thread starter Thread starter AHopper
  • Start date Start date
A

AHopper

When I print only the last page of a report I get
different answers for the a calculated overall percentage
than when I print the whole report.

Full report 21.73 percent
Last page only report 20.23 percent

Everything else on the last page is the same for full
report or last page only report.

What could be causing this to happen?

Allan
 
AHopper said:
When I print only the last page of a report I get
different answers for the a calculated overall percentage
than when I print the whole report.

Full report 21.73 percent
Last page only report 20.23 percent

Everything else on the last page is the same for full
report or last page only report.

What could be causing this to happen?

Allan
Allan,
You must be computing the percentages by code in the Reports Detail
Print event.
If the page doesn't get printed the print event doesn't fire and the
calculations are wrong.

The best place to do report calculations is using unbound control's (or
bound controls with their Running Sum property set to Over All or Over
Group) in the detail section itself, not by using code.

This way the computation is accurate, even if the page is not printed.
 
Alan:

You don't indicate how the calculation is being conducted within the report.
Is done via some VBA functions that fire in various events? If as example
you have it in the On print event and that event doesn't fire because the
section isn't printed for a certain page (where possibiliy you have
accumulators working in the vba, that could be a cause of your problem.
 
Steve:
You are right I have VBA doing calculation in the On Print
event of the Detail section and I have text boxes doing
running Sum. I open the report in preview and keep it from
being view by turning off Echo. Is there another event or
way I should be doing this?

Thanks
Allan
 
Back
Top