Create “Subreports”

With “Subreports”, we can see the details of a report as a subreport within the original report.

This allows us to view related data from two “Reports” in one report.

On several occasions we will use two reports , data from one report, with detailed data from another report, to display in a related “Subreport”.

If we want a “Subreport”, it is wise to first make two “Reports”.
This is not mandatory but it makes it just easier in the future.

We can create “Subreports” of almost any database object that we have created, “Tables”, “Forms” and “Queries”.

Unlike “Subforms”, where we simply click and drag the subform to the main form, in subreports usually, not always, it is a little more complicated because we need to link between the two “Reports”.
If you get the data for both “Reports” from the same object, then you can still apply the click-and drag method.

But in this example we retrieve data from two different objects, so we have a link between the two “Reports”

Our first report (Products Supplier Report), we make from “Suppliers” query.
The second report (Products Suppliers SubReport), we make from ” Supplier Products” query.
Both have a related field, the “SuppliersID” field.

We open the main report, and add a title in the “Report Header” section, and the “Company Name” field in the “Detail” Section.

Once we click on the “Control Wizard” button , the “SubReport Wizard” will start automatically.

We click the “Subform” button in the “Toolbox”.
Then click and drag into the “Detail” section on the place where we want a “Subform”.
The “Subreport Wizard” starts

In the first window we have to choose which “SubForm” what we want to insert in our Main Form.

We choose the “Subform” that we have already created.

We click “Next”.
In the next window we have the choice “Choose from a list”, which automatically fills out the links for us, and “Define my own” where we ourselves have to choose our links via dropdown menus.
To make it easy for us, we choose the first option.

And click on “Finish”.

The subform is inserted into the “Detail” section of our main form:

Result:

Awesome!
You've completed Lesson 15
START NEXT LESSON