Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Do My Calculations Change from Preview to Print?

Troubleshooting

Why Do My Calculations Change from Preview to Print?

by  Sameal  Posted    (Edited  )
If you use VB behind your reports to build calculations then you may encounter this problem much the same way I did. It all happened when I used three variables to hold accumulation totals so that when the report got to the footer, those three variables held the totals to display.

The phenomenon occured when I previewed the report and all my totals were correct, but after I clicked Print the totals doubled exactly to the penny.

After a some thought I figured out that the Reports must calculate twice to print. Once to create the preview and then a second time when printing. The problem was that the accumulation variables were being added to twice.

The solution is to provide correct initialization of your variables. They must be initialized first when the report is first opened, and then a second time when the report is sent to the printer. The names of these two events are Report_Open and Report_Page.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top