Print Preview differs from printer & pdf output

D

David Roseberry II

I created a program using Access 97 in which I have created reports that
hide or show the Page Footer based on if the page is the first for the group
of data. I already have the coding complete and the report shows exactly
how I want in Print Preview, however when I click to print the report, the
Page Footer on the very first page does not show (even though it shows on
the screen). Each subsequent page 1 for each group of data prints the
footer appropriately.

Has anybody else run into this same issue where the Print Preview on screen
and the actual output to the printer or pdf file is different?

I did find one small work-around. If I click the double chevron to the very
last page of the report and then return to page 1 and print the report, the
footer prints correctly. This is the only way that I got this to work.

Thanks!

P.S. I tried the same thing using Access 2003 and ran into the same exact
bug. Unfortunately my company does not have 2007 available or I would have
tested it in the latest version.
 
M

Marshall Barton

David said:
I created a program using Access 97 in which I have created reports that
hide or show the Page Footer based on if the page is the first for the group
of data. I already have the coding complete and the report shows exactly
how I want in Print Preview, however when I click to print the report, the
Page Footer on the very first page does not show (even though it shows on
the screen). Each subsequent page 1 for each group of data prints the
footer appropriately.

Has anybody else run into this same issue where the Print Preview on screen
and the actual output to the printer or pdf file is different?

I did find one small work-around. If I click the double chevron to the very
last page of the report and then return to page 1 and print the report, the
footer prints correctly. This is the only way that I got this to work.


Don't rely on the section's Visible property design view
setting when you are manipulating it in code. In other
words, you need to initialize it in code, probably using the
report header section's Format or Print event.
 
D

David Roseberry II

Marshall Barton said:
Don't rely on the section's Visible property design view
setting when you are manipulating it in code. In other
words, you need to initialize it in code, probably using the
report header section's Format or Print event.



Thanks so much for your reply. Could you please provide example(s) on how
to initialize the report footer to show on Page 1 only and to be hidden on
subsequent pages in that report group without using the Visible property? I
apologize if this is elementary but I am fairly new to using vba.

Much appreciated!

Dave
 
M

Marshall Barton

David said:
"Marshall Barton" wrote

Thanks so much for your reply. Could you please provide example(s) on how
to initialize the report footer to show on Page 1 only and to be hidden on
subsequent pages in that report group without using the Visible property? I
apologize if this is elementary but I am fairly new to using vba.


You said that you have everything working, except when you
preview before printing. So, the only thing you need to add
is one line to the Report Header section's Format event:
Me.Section(4).Visible = True

If you so not have the Report Header section, add it (View
Menu) ans set its Height to 0
 
D

David Roseberry II

Marshall Barton said:
You said that you have everything working, except when you
preview before printing. So, the only thing you need to add
is one line to the Report Header section's Format event:
Me.Section(4).Visible = True

If you so not have the Report Header section, add it (View
Menu) ans set its Height to 0

Thanks again for your reply. I added what you put but the Page Footer still
does not print out on page 1 even though it displays on the screen. Here is
the coding that I am using:

Private Sub Report_Page()

If Me.Page > 0 Then
Me.Section(acPageFooter).Visible = False
Else
Me.Section(acPageFooter).Visible = True
End If

End Sub

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

[Page] = 0

End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

Me.Report.Section(4).Visible = True

End Sub


Thanks again for your assistance!
 
D

David Roseberry II

David Roseberry II said:
Marshall Barton said:
You said that you have everything working, except when you
preview before printing. So, the only thing you need to add
is one line to the Report Header section's Format event:
Me.Section(4).Visible = True

If you so not have the Report Header section, add it (View
Menu) ans set its Height to 0

Thanks again for your reply. I added what you put but the Page Footer still
does not print out on page 1 even though it displays on the screen. Here is
the coding that I am using:

Private Sub Report_Page()

If Me.Page > 0 Then
Me.Section(acPageFooter).Visible = False
Else
Me.Section(acPageFooter).Visible = True
End If

End Sub

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

[Page] = 0

End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

Me.Report.Section(4).Visible = True

End Sub


Thanks again for your assistance!

WOW! Ok, I was able to get it to work (finally!) so I am posting this
information in case anybody else has experienced this ...

Here is the coding that finally worked:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

Page = 0

End Sub

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

Page = 1

End Sub

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)

If Me.Page > 1 Then
Me.Report.Section(4).Visible = False
Else
Me.Report.Section(4).Visible = True
End If

End Sub
 
M

Marshall Barton

David said:
Marshall Barton said:
You said that you have everything working, except when you
preview before printing. So, the only thing you need to add
is one line to the Report Header section's Format event:
Me.Section(4).Visible = True

If you so not have the Report Header section, add it (View
Menu) ans set its Height to 0

Thanks again for your reply. I added what you put but the Page Footer still
does not print out on page 1 even though it displays on the screen. Here is
the coding that I am using:

Private Sub Report_Page()

If Me.Page > 0 Then
Me.Section(acPageFooter).Visible = False
Else
Me.Section(acPageFooter).Visible = True
End If

End Sub

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

[Page] = 0

End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

Me.Report.Section(4).Visible = True

End Sub


I think that looks to me like it should work in all
situations so I'm baffled. The only thing I can suggest is
to use the page header's Format or Print event instead of
the Page event:

Me.Section(acPageFooter).Visible = (Me.Page = 1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top