TheSearcher
Registered User.
- Local time
- Today, 08:48
- Joined
- Jul 21, 2011
- Messages
- 395
I have the following code in the On Print event of my report footer:
	
	
	
		
The msgbox tells me that I'm on page 1 - but the controls are still visible (on a 1 page report). However, on a 2 page report it works correctly.
Any ideas why this would be happening?
Thanks in advance,
TS
 
		Code:
	
	
	Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
If Me.Page = 1 Then
     MsgBox Me.Page
     Me.[lbl_ClientName_Footer].Visible = False
     Me.[txt_ClientName_Footer].Visible = False
Else
     Me.[lbl_ClientName_Footer].Visible = True
     Me.[txt_ClientName_Footer].Visible = True
End If
End SubThe msgbox tells me that I'm on page 1 - but the controls are still visible (on a 1 page report). However, on a 2 page report it works correctly.
Any ideas why this would be happening?
Thanks in advance,
TS
 
	 You should also look up the Retreat event as well.  I don't think it will have any impact on this particular requirement, but it is very important to understand the rendering process for a report.  To summarize, Access formats a section before it knows if it has room on the page to actually print it.  If there is no room, it runs the retreat event.  Then goes through the pagination process to create the footer for the current page and the headers for the next page and then it goes back to the Format event again.
  You should also look up the Retreat event as well.  I don't think it will have any impact on this particular requirement, but it is very important to understand the rendering process for a report.  To summarize, Access formats a section before it knows if it has room on the page to actually print it.  If there is no room, it runs the retreat event.  Then goes through the pagination process to create the footer for the current page and the headers for the next page and then it goes back to the Format event again. 
 
		 
 
		