Microsoft KB Archive/125771

= ACC2: Grouped Subreport Prints Each Record on a New Page =

Article ID: 125771

Article Last Modified on 6/25/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q125771



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
When you print or preview a report that contains a subreport, the first page is correct but subsequent pages each contain only one line of data from the subreport. The subreport is grouped with the group's ForceNewPage property set to either BeforeSection or AfterSection.



RESOLUTION
To correct this problem, create the same type of grouping in the main report and control the new pages from the main report rather than the subreport. For an example of how to use this solution, follow the steps in the "Steps to Reproduce Problem" and "Steps to Correct Problem" sections later in this article.



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.



Steps to Reproduce Problem
 Open the sample database NWIND.MDB. Create a blank new report based on the Products table. From the View menu, choose Sorting And Grouping. In the first Field/Expression cell, select Category ID. Set the group's GroupHeader property to Yes and then close the Sorting And Grouping dialog box.  Add a text box with the following properties to the Category ID header section:

      Name: Category ID       ControlSource: Category ID                          Add a text box with the following properties to the detail section:

<pre class="fixed_text">      Name: Product Name ControlSource: Product Name </li> Select the Category ID header section and then set its ForceNewPage property to BeforeSection.</li> From the Format menu, choose Page Header/Footer to remove the page header and footer.</li> Preview the report. Note that there is a new page for each Category ID.</li> Save the report as Report1 and then close it.</li> Create a blank new report that is not based on any table or query.</li> Drag the Report1 report from the Database window to the detail section of the blank new report.</li> Save the report as Report2.</li> Preview the report. Note that the first page is correct, but subsequent pages each contain only one line of data.</li></ol>

Steps to Correct Problem

 * 1) View the Report2 report (the main report) in Design view. Set the report's RecordSource property to the Categories table.
 * 2) Set the subreport control's LinkMasterFields and LinkChildFields properties to Category ID.
 * 3) Set the detail section's ForceNewPage property to BeforeSection.
 * 4) Double-click the subreport control to open the subreport. Select the Category ID header section and set its ForceNewPage property to None.
 * 5) Save the subreport and then close it.
 * 6) Save the main report and then close it.
 * 7) Preview the main report (Report2). Note that there is one page for each Category ID.

Keywords: kbbug kbusage KB125771

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.