ACC2: Group Header or Group Data Missing on Page 1 of a Report

ID: Q130368


The information in this article applies to:


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you print a report, the report header and the page header are printed on page 1, but not the group header or the group's detail information.


CAUSE

The group header's ForceNewPage property is set to BeforeSection.


RESOLUTION

This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Access Basic, please refer to the "Building Applications" manual.

To work around this problem, create a page break before each group value on the report.

To create the page break on your report, follow these steps:

  1. Open the report in Design view.


  2. Select the group header section and set the ForceNewPage property to None.


  3. In the group header section, create a Page Break control at the top of the section and set the following properties for the control:
    
          Name: GroupHdrPageBreak
          Top: 0 


  4. Create a module and type the following lines in the Declarations section:
    
          Option Explicit
          Dim FirstOne As Integer 


  5. Type the following functions:
    
          Function RHdrOnFormat()
             FirstOne = -1
          End Function
    
          Function GrpHdrFormat (Rpt As Report)
             If Rpt.page = 1 And FirstOne = -1 Then
                Rpt!GroupHdrPageBreak.visible = False
             Else
                Rpt!GroupHdrPageBreak.visible = True
             End If
             FirstOne = 0
          End Function 


  6. Set the report header's OnFormat property to the following function:
    
          =RHdrOnFormat() 


  7. Set the group header's OnFormat property to the following function:
    
          =GrpHdrFormat([Report]) 


  8. Choose Print Preview from the File menu. Note that page 1 contains the first group value and its records.



STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.


MORE INFORMATION

Steps to Reproduce Problem


  1. Open the sample database NWIND.MDB.


  2. In the Database window, make a copy of the List Of Products By Category report and name it TestReport.


  3. Open the TestReport report in Design view.


  4. Select the Category Name header section and set the ForceNewPage property to BeforeSection.


  5. Preview the TestReport report. Note that page 1 displays only the report header and page header sections. The first group value and its records appear on page 2 rather than page 1



REFERENCES

For more information about forcing new pages in a report, search for "ForceNewPage," and then "ForceNewPage Property" using the Microsoft Access Help menu.


Keywords          : kbusage RptLayou 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 3, 1999