About subreports

A subreport is a report that's inserted in another report. When you combine reports, one of them must serve as the main report. A main report is either bound or unbound; that is, it is or isn't based on a table, query, or SQL statement.

Example of an unbound main report with two unrelated subreports

An unbound main report can serve as a container for unrelated subreports that you want to combine.

Unbound main report with two subreports displaying unrelated data

1  The unbound main report contains two subreports.

2  One subreport summarizes sales by employee.

3  The other subreport summarizes sales by category.

Example of a main report and subreport that are bound to the same record source

You can use the main report to show detail records, such as every sale in a year, and then use a subreport to show summary information, such as the total sales for each quarter.

Main report and subreport bound to the same record source

1  The subreport summarizes the year's sales by quarter.

2  The main report lists the day-to-day sales.

Example of a main report and a subreport that are bound to related record sources

A main report can contain data common to two or more parallel subreports. In this case, the subreport contains data that is related to the data in the main form.

Main report and subreport displaying related data

1  The main report lists the name and city of each fair.

2  The subreport lists the representatives who will attend each fair.

Subforms in a report

A main report can include subforms as well as subreports, and it can include as many subforms and subreports as you want. Additionally, a main report can contain up to two levels of subforms and subreports. For example, a report can contain a subreport, and that subreport can contain a subform or a subreport. The following table shows the possible combinations of subforms and subreports in a main report.

Level 1 Level 2
Subreport 1 Subreport 2
Subreport 1 Subform 1
Subform 1 Subform 2

Synchronizing a report and subreport

When you insert a subreport that contains information related to data in the main report, the subreport control must be linked to the main report. The link ensures that the records printed in the subreport correspond correctly to the records printed in the main report.

When you create a subreport by using a wizard or by dragging a report or datasheet from the Database window to another report, Microsoft Access automatically synchronizes the main report and subreport if:

Note   The Sales by Category and Sales by Year reports in the Northwind sample database use subreports. To view these reports, open the Northwind database in the Samples subfolder of your Microsoft Office folder, and then open the report in Design view.