JudyT said:
I tried the following Codes individually and together (Report Format with
Group Format and Report Print with Group Print). All gave me the same
results: The footer was removed from all pages.
When I take the Event Procedure off of the Subreport's On Open the report
footer does come back on all pages so I know it is the Subreport Event
Procedure that is removing it. I just can't get it to show back up on the
Main Report pages.
Private Sub GroupHeader6_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(4).Visible = True
End Sub
Private Sub GroupHeader6_Print(Cancel As Integer, PrintCount As Integer)
Me.Section(4).Visible = True
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Section(4).Visible = True
End Sub
Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
Me.Section(4).Visible = True
End Sub
Don't try to use both events. Determine the one that works
(usually the Format event) and use that one.
After a lot of testing, I'm finding that all this stuff is
significantly different than it was in A97. The subreport's
Open event is triggered before the main report's first page
header events!? The subreport's records seems to be
processed twice at arbitrary points?! Making the main
report's page footer visible appears to be ineffective most
everywhere except in the page header??
Let's try a different approach.
First, create another main report group (with footer) on the
same field as your existing group. Put the controls before
your page break in the inner group's footer and the
subreport in the outer group footer.
Get rid of the page break control and instead, set the outer
group footer's ForceNewPage property to Before Section.
In the main report's module, declare a variable named
SubRpt:
Public bolSubRpt As Boolean
at the top of the module, before any Sub and Function
declarations.
Then add this line of code to the main report's inner group
footer's Print event:
bolSubRpt = False
(If the subreport does not have the report footer section,
add it (View menu) and set its Height to zero.)
Add this line to the subreport's report footer's Print event
Parent.bolSubRpt = True
Finally, add this line to the main report's page header's
Format event:
Me.Section(4).Visible = bolSubRpt