Microsoft KB Archive/130368

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

Article ID: 130368

Article Last Modified on 7/5/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q130368



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



SYMPTOMS
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:

 Open the report in Design view. Select the group header section and set the ForceNewPage property to None.  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   Create a module and type the following lines in the Declarations section:

     Option Explicit Dim FirstOne As Integer   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 </li>  Set the report header's OnFormat property to the following function:

<pre class="fixed_text">     =RHdrOnFormat </li>  Set the group header's OnFormat property to the following function:

<pre class="fixed_text">     =GrpHdrFormat([Report]) </li> Choose Print Preview from the File menu. Note that page 1 contains the first group value and its records.</li></ol>

<div class="status_section">

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.

<div class="moreinformation_section">

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

<div class="references_section">