Page numbering and contiditional formatting of headers

G

Guest

I have a report where I have a Group header that I want to print on the first
page of the report for the group. I have a page header that I want to appear
on pages 2-the end for each group.

Here is the code I am using:

Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
Page = 1
If Page = 1 Then
GroupHeader2.Visible = True
Else
GroupHeader2.Visible = False
End If
End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
If Page = 1 Then
PageHeaderSection.Visible = False
Else
PageHeaderSection.Visible = True
End If

End Sub

It works great for the first group, but all other groups, both headers
appear on the first page. The Page header does not recognize that Page = 1
at the change of the grouping.

How can I get this to work correctly?

Thanks!
 
R

Rick B

I'm pretty sure there are properties in the headers that let you indicate
whether they print with a report header or not. Saying not would prevent
them from showing up on the first page.
 
G

Guest

I treid every setting I could find and nothing worked. The group header is
working correctly, it's the Page header that is not working properly. I
don't have a report header and that's the only setting that I could find
where you could set it to "Not with Rpt Hdr"
 
M

Marshall Barton

Baffee said:
I have a report where I have a Group header that I want to print on the first
page of the report for the group. I have a page header that I want to appear
on pages 2-the end for each group.

Here is the code I am using:

Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
Page = 1
If Page = 1 Then
GroupHeader2.Visible = True
Else
GroupHeader2.Visible = False
End If
End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
If Page = 1 Then
PageHeaderSection.Visible = False
Else
PageHeaderSection.Visible = True
End If

End Sub

It works great for the first group, but all other groups, both headers
appear on the first page. The Page header does not recognize that Page = 1
at the change of the grouping.


Use the Group Header section's Format or Print event to make
the Page Header visible. Use the Group Footer section's
Format or Print event to make the Page Header visible.

There is no need to make the group header visible or
invisible since it only appears once per group (unless you
have the group header's Repeat Section property set to Yes,
in which case you can not make it invisible).

You can set Me.Page = 1 if that's what you want, but there
is no use in testing if it is 1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top