In this article we explore the need of subreports and learn to create them too.
We create reports in MS Access to summarize data in a database, but there might be a need to create a summary of two related tables, in this situation, a user can make use of a subreport. Subreports are the reports of related tables and not complete databases, these can be inserted in a main report. Subreports prove to be an essential part of the Report feature in MS Access, by using subreports apart from the main reports, a user can emphasize more on fields that are related and should be paid attention to.
Why should we use subreports / why are subreports important?
By inserting a subreport in a main report, the importance of two related fields can be highlighted in a meaningful and comprehensive way. Inserting a subreport in a main report is fairly easy, you can use the wizard to insert a subreport or a subreport control, and both the main report as well as the subreport appear as objects explicitly in the Reports Group in Navigation Pane. A subreport proves useful in databases with all kinds of data, for example – If a company needs a report on the annual sales profit, it can create a report with 12 months of sales record. The user can however highlight the months with highest or the lowest sales profits using subreports. This will clearly indicate which were the months with marked the highest or lowest profits throughout a financial year.
How to increase the importance of a subreport?
Although a report and a subreport, both are equally important, the usefulness of a subreport can be increased by including calculations in it, as this will make it more informative. To inform Access about what kind of calculations do you want to perform and on what fields, you can insert unbound controls and expressions builder for creating expressions about informing Access. This way you can have both statistics and summary in your report and subreport, thus making it all the more important and relevant.
Steps for creating / inserting a Subreport using a Subreport Wizard
- Open the main report in Design View. Go to Design ribbon, in the Controls Group, select Use Controls Wizard.
- Now you have to go to Subreports, in the same Controls group. You have now activated the subreport Wizard.
- In the main report, select where do you want to place the subreport. When you click on the spot, the subreport wizard will display.
- Select whether you want to base the report on ‘Existing Table or Query’, or on ‘Existing Report’. Click on Next.
- In – case of Existing Tables and Queries, select the tables and queries, in-case of Existing Report, select the fields for creating the link.
- You can either choose an existing link or create a one by yourself. Click on Next to proceed to the next step.
- Your subreport will now get linked to the main report, select a name for the subreport, and click on Finish.
As with all other data contained in an Access database, subreports too remain vulnerable in the event of an Access crash. Thus it is always ideal to keep an Access recovery tool handy.
Vivian Stevens is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover Sql Server and excel recovery software products. For more information visit www.datanumen.com