The information in this article applies to:
- Microsoft Access version 2.0
SYMPTOMS
Novice: Requires knowledge of the user interface on single-user computers.
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.
MORE INFORMATION
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:
Name: Product Name
ControlSource: Product Name
- Select the Category ID header section and then set its ForceNewPage
property to BeforeSection.
- From the Format menu, choose Page Header/Footer to remove the page
header and footer.
- Preview the report. Note that there is a new page for each Category ID.
- Save the report as Report1 and then close it.
- Create a blank new report that is not based on any table or query.
- Drag the Report1 report from the Database window to the detail section
of the blank new report.
- Save the report as Report2.
- Preview the report. Note that the first page is correct, but subsequent
pages each contain only one line of data.
Steps to Correct Problem
- View the Report2 report (the main report) in Design view. Set the
report's RecordSource property to the Categories table.
- Set the subreport control's LinkMasterFields and LinkChildFields
properties to Category ID.
- Set the detail section's ForceNewPage property to BeforeSection.
- Double-click the subreport control to open the subreport. Select the
Category ID header section and set its ForceNewPage property to None.
- Save the subreport and then close it.
- Save the main report and then close it.
- Preview the main report (Report2). Note that there is one page for each
Category ID.