geeta_m9
asked on
Want report header to appear on alternate pages only
Is there a way to get MS-Access to print the report header on alternate pages only, i.e., first page, third page, etc. I am printing in duplex, and do not want the alternate pages (e.g., second, fourth, pages etc.) that are printed in the back have the header.
Not the report header no, but the page header yes. Follow Jim's comment.
Jim.
Jim.
<correction, need more coffee>
Private Sub PageHeaderSection_Format(C ancel As Integer, FormatCount As Integer)
If Me.Page / 2 = CInt(Me.Page) Then
'Even numbered pages
Me.PageHeaderSection.Visib le = False
Else
'Odd numbered pages
Me.PageHeaderSection.Visib le = True
End If
End Sub
Private Sub PageHeaderSection_Format(C
If Me.Page / 2 = CInt(Me.Page) Then
'Even numbered pages
Me.PageHeaderSection.Visib
Else
'Odd numbered pages
Me.PageHeaderSection.Visib
End If
End Sub
ASKER
Sorry, I meant to say page header, not report header.
ASKER
I tried inserting your code, but now the header does not appear at all.
Copy-paste your code into this question.
ASKER
Private Sub PageHeaderSection_Format(C ancel As Integer, FormatCount As Integer)
If Me.Page / 2 = CInt(Me.Page) Then
'Odd numbered pages
Me.PageHeaderSection.Visib le = True
Else
'Even numbered pages
Me.PageHeaderSection.Visib le = False
End If
End Sub
If Me.Page / 2 = CInt(Me.Page) Then
'Odd numbered pages
Me.PageHeaderSection.Visib
Else
'Even numbered pages
Me.PageHeaderSection.Visib
End If
End Sub
Do:
If Me.Page Mod 2 = 0 Then
'Even numbered pages
Me.PageHeader0.Visible = False
Else
'Odd numbered pages
Me.PageHeader0.Visible = True
End If
Note that "PageHeader0" should be the actual name of your page header section.
Jim.
If Me.Page Mod 2 = 0 Then
'Even numbered pages
Me.PageHeader0.Visible = False
Else
'Odd numbered pages
Me.PageHeader0.Visible = True
End If
Note that "PageHeader0" should be the actual name of your page header section.
Jim.
ASKER
How do I find out what is the name for my page header section?
ASKER
I looked up the Name under Properties. It is just called PageHeaderSection.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think it is working because in the Print Preview section, the heading does not come out for the second page. Let me try printing it out.
ASKER
It looks like it is working, thanks. I just have one concern though. I only manage to test this on one record so far. If I print out multiple records, will they all have the first page with the header and the second page without the header on the reverse side?
BTW, this will only work in Normal (direct to printer) or Preview mode, as code will not fire in the Report view.
ASKER
That's ok. We just want to print it out.
Actually, I think you want the header on odd numbered pages, not even, so you might want to try:
If Me.Page Mod 2 = 1 Then
If Me.Page Mod 2 = 1 Then
If I print out multiple records, will they all have the first page with the header and the second page without the header on the reverse side?Maybe. The way this is designed is to print the page header on every other page. If you have want to print for multiple records, then you will need to ensure that every "record" starts on an odd page.
ASKER
Well each report will be exactly two pages long.
ASKER
This morning I printing out the reports and they all look great, thanks.
Thanks for the grade. Good luck with your project. -Jim
ASKER
Thanks!
Private Sub PageHeaderSection_Format(C
If Me.Page / 2 = CInt(Me.Page) Then
'Odd numbered pages
Me.PageHeaderSection.Visib
Else
'Even numbered pages
Me.PageHeaderSection.Visib
End If
End Sub