Printing is different from Preview...

  • Thread starter Thread starter Jon Dragt
  • Start date Start date
J

Jon Dragt

Using Access 2002, I have a complicated report that hides
columns and groupings based on the users selection. I use
an array to accumilate column totals. I update the array
in the Detail_Print sub. I set a textbox value in the
Group Footer with the array value during the Group Footer
Print sub and then zero out the accumilating array.

This seems to work fine except for one scenario. The user
pulls up the report in preview mode and it displays page
one. If the details run several pages before it gets to
the group footer and the user simply prints the report
without scrolling down to the group footer the printed
version of the totals in the group footer includes the
totals from the displayed page twice, once for displaying
the page and once for printing it. If the user were to
scroll down to the page with the first group footer then
it prints just fine.

I can guess what's happening internally with Access but
I'm at wits ends on how to work around this! Relying on
the user to scroll through the report before printing is
not a good answer.

Help! Any Clues?

Cheers,
Jon
 
Using Access 2002, I have a complicated report that hides columns
and groupings based on the users selection. I use an array to
accumilate column totals. I update the array in the Detail_Print
sub. I set a textbox value in the Group Footer with the array
value during the Group Footer Print sub and then zero out the
accumilating array.

This seems to work fine except for one scenario. The user pulls up
the report in preview mode and it displays page one. If the
details run several pages before it gets to the group footer and
the user simply prints the report without scrolling down to the
group footer the printed version of the totals in the group footer
includes the totals from the displayed page twice, once for
displaying the page and once for printing it. If the user were to
scroll down to the page with the first group footer then it prints
just fine.

I can guess what's happening internally with Access but I'm at
wits ends on how to work around this! Relying on the user to
scroll through the report before printing is not a good answer.

Help! Any Clues?

Cheers, Jon

Declare the variables used for the calculations in the Declarations
section of the code sheet (up with the Option Explicit statement).

Then reset all the variables and controls used to Zero in the Report
Header Format event:
[ControlName] = 0
intX = 0
etc. The Report Header will fire on both Preview and Print and reset
all the variables and controls.
 
That's it! Perfect. Thanks.
-----Original Message-----
Using Access 2002, I have a complicated report that hides columns
and groupings based on the users selection. I use an array to
accumilate column totals. I update the array in the Detail_Print
sub. I set a textbox value in the Group Footer with the array
value during the Group Footer Print sub and then zero out the
accumilating array.

This seems to work fine except for one scenario. The user pulls up
the report in preview mode and it displays page one. If the
details run several pages before it gets to the group footer and
the user simply prints the report without scrolling down to the
group footer the printed version of the totals in the group footer
includes the totals from the displayed page twice, once for
displaying the page and once for printing it. If the user were to
scroll down to the page with the first group footer then it prints
just fine.

I can guess what's happening internally with Access but I'm at
wits ends on how to work around this! Relying on the user to
scroll through the report before printing is not a good answer.

Help! Any Clues?

Cheers, Jon

Declare the variables used for the calculations in the Declarations
section of the code sheet (up with the Option Explicit statement).

Then reset all the variables and controls used to Zero in the Report
Header Format event:
[ControlName] = 0
intX = 0
etc. The Report Header will fire on both Preview and Print and reset
all the variables and controls.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Jon:

Are you resetting the accumulators that you are using in each group header?
Or are you relying on simple Sum() functions in the footer. If the later
you best move the accumulation algorithm to VBA where you can control when
variables are reset.
 
Back
Top