Change DATA on PAGE FOOTER based on page #. Is it possible?

musicmaker

Registered User.
Local time
Today, 18:27
Joined
Jun 29, 2000
Messages
17
This is the requirement for the PAGE FOOTER:

field name [varJim]

On Page 1.... varJim = Summary Index

On Page 2.... varJim = Page 1 of Details

On Page 3.... varJim = Page 2 of Details

On Page 4.... varJim = Page 1 of Misc.

etc.

Thank you so much in advance for any suggestions!!!
 
After twenty hours of research, I figured this out. Here is how to do it, if others are interested.

There are three steps:

1.) Insert a Text Box in the Page Footer Section, then goto Text Box Properties, then Data (tab), and OnSource, enter: = [Page] next goto Format (tab) and OnVisible, enter No.

2.) Insert a Label in the page footer. Type the following (one word) inside the Label: lblvarJim The first and third letter is a lowercase L, not a one. Then goto the Label Properties and make sure the Name is set to: lblvarJim

3.) Goto the Page Footer Properties, then goto Event (tab), then, OnPrint click … goto Code Builder and insert the following:


Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
Dim varJim As Variant
If Me.Page = 1 Then
varJim = "Summary Index"
End If
If Me.Page = 2 Then
varJim = "Page " & [Page] - 1 & " of Details"
End If
If Me.Page >= 3 Then
varJim = "Page " & [Page] - 1 & " of Details"
End If
If Me.Page >= 4 Then
varJim = "Page " & [Page] - 3 & " of Misc."
End If
With Me
!lblvarJim.Caption = varJim
End With

End Sub
 
Cool!
 

Users who are viewing this thread

Back
Top Bottom