Event Programming - on print

  • Thread starter Thread starter dg
  • Start date Start date
D

dg

Hi

I have a complex report which contains a number of calculations. Many of
which are calculated in vba then displayed in an unbound text box. The
results are totaled from group footer and displayed in the report footer.

I have the problem that the results are shown correctly on screen, howeve if
you print the report from the preview screen, it recalculates all the
calculations in the onprint event and doubles the results.

If the report is printed direct to the printer, no preview, the results
appear correct.

I do need the abillity to print from the preview.

Any suggestions

Thanks

D.
 
I do everything possible to avoid summing and other calculations in the
event code of the report. If you described what you are attempting to do and
why, maybe someone could suggest an alternative.

Otherwise I expect you may need to reset some variables in the On Open or
some other event. Can't tell without seeing the code.
 
Hi

I have a complex report which contains a number of calculations. Many of
which are calculated in vba then displayed in an unbound text box. The
results are totaled from group footer and displayed in the report footer.

I have the problem that the results are shown correctly on screen, howeve if
you print the report from the preview screen, it recalculates all the
calculations in the onprint event and doubles the results.

If the report is printed direct to the printer, no preview, the results
appear correct.

I do need the abillity to print from the preview.

Any suggestions

Thanks

D.

It's always best to use controls within the report to do the
calculations.

If for some reason you cannot, then use the Report Header Format event
to reset all the controls (and the variables) to = 0.
 
dg said:
*Hi

I have a complex report which contains a number of calculations.
Many of
which are calculated in vba then displayed in an unbound text box.
The
results are totaled from group footer and displayed in the repor
footer.

I have the problem that the results are shown correctly on screen
howeve if
you print the report from the preview screen, it recalculates al
the
calculations in the onprint event and doubles the results.

If the report is printed direct to the printer, no preview, th
results
appear correct.

I do need the abillity to print from the preview.

Any suggestions

Thanks

D.


-
ron
 
Try using the OnFormat event instead. I use it all the time fo
calculating values, and then applying results to report controls.
*Hi

I have a complex report which contains a number of calculations.
Many of
which are calculated in vba then displayed in an unbound text box.
The
results are totaled from group footer and displayed in the repor
footer.

I have the problem that the results are shown correctly on screen
howeve if
you print the report from the preview screen, it recalculates al
the
calculations in the onprint event and doubles the results.

If the report is printed direct to the printer, no preview, th
results
appear correct.

I do need the abillity to print from the preview.

Any suggestions

Thanks

D.


-
ron
 
Back
Top