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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page footer on odd pages only

Status
Not open for further replies.

SmallTime

Technical User
May 17, 2004
127
GB
Hi all,

Could someone be kind enough to show me how to produce a report where the page footer is shown on every other page (odd pages) only?

Many thanks
 
You need to create a couple of event procedures, thus:
Code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
    Me.PageFooterSection.Visible = (Me.Page Mod 2 = 1)
End Sub

Private Sub Report_Page()
    Me.PageFooterSection.Visible = True
End Sub

You use the PageFooterSection's OnFormat event to set visibility depending on whether the page number is odd or even (Me.Page returns the page number, then Mod 2 returns 1 if the page is odd, 0 otherwise).

You then need to use the Report's OnPage event to set the footer's visibility back to True at the start of each page, otherwise once the footer has been made invisible for the first time (on page 2), the subsequent page footer's OnFormat events won't be called unless the footer is visible.

This isn't very elegant, but it works. [thumbsup2]

[pc2]
 
Many thanks for your reply mp9.

I'll give it a bash latter today.

I was hoping to somehow get rid of the footer altogether and leave adequate space of other stuff, but seems I'll just have to work around the layout of the documents a bit more.

Good suggestion.

Ta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top