Creating Multi-Table Reports
You can also create reports that include information from more than one table or query. The process is the same as the procedure that you used in Lesson 19, "Creating a Simple Report," when you used the Report Wizard to create a report. All you have to do is select fields from related tables during the report creation process. This allows the report to pull information from the related tables.
An alternative to creating reports that contain fields from more than one table is to create a report that contains a subreport. The procedure is similar to the procedure discussed in the previous section, when you created a main form that held a subform.
Subreport A report control that consists of an entire report based on another table or tables.
To create a report that contains a subreport, follow these steps:
Use the AutoReport feature, the Report Wizard, or the Report Design view to create two reports: the report that serves as the main report and the report that serves as the subreport. These reports should be based on tables that are related.
In the Report Design view, open the report that will serve as the main report. Size the area in which you will place the subreport. For example, you might want to place the subreport in the Report Header area so that it can be viewed on any page of the printed report.
Size the Report Design window so that you can also see the database window in the Access workspace.
In the database window, be sure that the Reports list is showing. Then, drag the report that will serve as the subreport onto the main report in the Design view window. Don't release the mouse until you have positioned the mouse pointer in the area (such as the Report Header) where you want to place the subreport.
Size or move the subreport control as needed and then save any changes that you have made to the main report.
When you view the composite report in the Print Preview mode, the subreport appears as part of the main report. Figure 21.9 shows the composite report in the Print Preview mode. Placing subreports on a main report enables you to include summary data that can be referenced while data on the main report is viewed either on the screen or on the printed page.
Figure 21.9. Composite reports enable you to report the data in different ways on the same report.
In this lesson, you learned how to create queries, forms, and reports based on more than one srelated table. In the next lesson, you learn how to print Access objects.