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

Changing Page Footer Main report after section in Sub Report

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,207
US
So currently I have a module scoped variable lngLastEnPage. I use this to determine my last English page as I know which section it occurs in per code below.
Then in the page footer I change the text I use. In reality I am using values from other hidden controls but for simplification, "Hello World".


Code:
Private Sub GroupHeader3_Format(Cancel As Integer, FormatCount As Integer)
  'Needs placed on last section for English letter
  If lngLastEnPage < Me.Page Then
    lngLastEnPage = Me.Page
  End If
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
  Dim lngPage As Long
  lngPage = Me.Page
  
  'Set Control according to value
  If lngPage > lngLastEnPage Then 
      Me!txtFooter = "Hola Mundo"
  Else
     Me!txtFooter = "Hello World"
  End If
End Sub

Because of code reuse, I want to move everything related to report header and footer to a main report. I am thinking of adding a lastEnPage property to the sub report to return the variable... Anybody know if something like that will work and if not what avenue to try? I just have not done a lot of crazy stuff with reports to have the nuances of the timing down for subreports and pagination. It seems sound in principle. Just realized my real problem is that I am going to have to always have that property or value going down this path even if it is all English.
 
I'm not quite sure what you are attempting to accomplish. However, I don't believe a subreport has any knowledge of Page or Pages or Page sections.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top