Solved

Hide page header on first page of group

Posted on 2008-06-26
5
1,611 Views
Last Modified: 2013-11-28
I have a report with one group. When the group header displaying, I want to suppress the page header (the group header contains same information as page header + some addition information). The group header information must be displayed before the page header information, therefore I cannot combine these. The group footer has set the "Force new Page" property to "After Section".

I have tried to manipulate page header sections visible property in vba, but without success.
0
Comment
Question by:tselectro
  • 3
  • 2
5 Comments
 
LVL 23

Expert Comment

by:irudyk
ID: 21877825
If I'm reading it correctly you want hide the Page header and display the Group header for page 1 and for pages 2 onwards, you want to display the Page header and hide the Group header.  If that is correct then try the following code to be place in the report page header's On Format routine.  You will need to change the PageHeaderSection and GroupHeader0 referneces to whatever they are called in your report.
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

PageHeaderSection.Visible = (Me.Page > 1)

GroupHeader0.Visible = (Me.Page <= 1)

End Sub

Open in new window

0
 

Author Comment

by:tselectro
ID: 21879017
Hi, that is not exactly what I want. The reports can consist of lots of records, in many groups. Ex. page 1-3 is record belonging to group 1, page 4 is group 2, page 5-10 is group 3 etc.  The page header section must be suppressed for every first page of group, i.e in this ex. page 1, page 4 and page 5.
(NB the reports have one group (ex ProductionID))
0
 
LVL 23

Expert Comment

by:irudyk
ID: 21879436
Okay, well try the following code
'Under the general declarations

Dim strProductionID As String
 

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

If strProductionID <> Obj Then

    strProductionID = Obj

    GroupHeader0.Visible = True

Else

    GroupHeader0.Visible = False

End If

End Sub
 

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

If strProductionID <> Obj Then

    PageHeaderSection.Visible = False

Else

    PageHeaderSection.Visible = True

End If

End Sub

Open in new window

0
 
LVL 23

Accepted Solution

by:
irudyk earned 500 total points
ID: 21879458
The Obj should have read ProductionID...See revised code below
'Under the general declarations

Dim strProductionID As String

 

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

If strProductionID <> ProductionID Then

    strProductionID = ProductionID

    GroupHeader0.Visible = True

Else

    GroupHeader0.Visible = False

End If

End Sub

 

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

If strProductionID <> ProductionID Then

    PageHeaderSection.Visible = False

Else

    PageHeaderSection.Visible = True

End If

End Sub

Open in new window

0
 

Author Closing Comment

by:tselectro
ID: 31471090
Hi, that is exactly what I want!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now