How to Create Subreports in Microsoft Access on Windows 11

Posted on 17th June 2023

Microsoft Access is a powerful tool for creating database applications. One of the features that makes Access so powerful is its ability to create subreports. Subreports are reports that are embedded in other reports. They are often used to display summary data from a related table or query. In this article, we will show you how to create a subreport in Microsoft Access on Windows 11.

Creating a Subreport

To create a subreport, first open the report that you want to embed the subreport in. Then, click the “Insert” tab on the ribbon. In the “Reports” group, click “Subreport”.

This will open the “Insert Subreport” dialog box. In the “Select Report” drop-down, select the report that you want to use as the subreport. Then, click “OK”.

Your subreport will now be inserted into the main report. You can move and resize the subreport as needed. To preview the report, click the “Preview” tab on the ribbon.

Adding a Subreport to a Form

You can also add a subreport to a form. To do this, open the form that you want to add the subreport to. Then, click the “Insert” tab on the ribbon. In the “Reports” group, click “Subreport”.

This will open the “Insert Subreport” dialog box. In the “Select Report” drop-down, select the report that you want to use as the subreport. Then, click “OK”.

Your subreport will now be inserted into the form. You can move and resize the subreport as needed. To preview the form, click the “Preview” tab on the ribbon.

Adding a Subreport to a Query

You can also add a subreport to a query. To do this, open the query that you want to add the subreport to. Then, click the “Insert” tab on the ribbon. In the “Reports” group, click “Subreport”.

This will open the “Insert Subreport” dialog box. In the “Select Report” drop-down, select the report that you want to use as the subreport. Then, click “OK”.

Your subreport will now be inserted into the query. You can move and resize the subreport as needed. To preview the query, click the “Run” button on the ribbon.

Conclusion

In this article, we showed you how to create subreports in Microsoft Access on Windows 11. Subreports are a powerful tool that can be used to display summary data from a related table or query. You can add subreports to reports, forms, and queries.

If you have a lot of data in your Microsoft Access database, you may want to create subreports. Subreports are a great way to organize your data and make it easier to find what you’re looking for.

To create a subreport, open your Microsoft Access database and click on the “Create” tab. Then, click on the “Report” button.

In the “New Report” window, select the table or query that you want to use for your subreport. Then, click on the “OK” button.

Now, you will see the “Report Wizard” window. In this window, you will need to select the fields that you want to include in your report. To do this, click on the “Fields” button.

In the “Select Fields” window, select the fields that you want to include in your report. Then, click on the “OK” button.

Now, you will see the “Layout” window. In this window, you can choose how you want your report to look. You can choose to have your report in a tabular format or a columnar format.

Once you have chosen the layout for your report, click on the “Next” button.

In the “Style” window, you can choose the style for your report. You can choose from a variety of different styles, such as “Corporate,” “Modern,” or “Traditional.”

Once you have chosen the style for your report, click on the “Next” button.

In the “Finish” window, you will need to give your report a name. Then, click on the “Finish” button.

Your subreport will now be created. To view your report, click on the “View” tab and then click on the “Report View” button.

First, open Microsoft Access and create a new blank database. Name the database “Sales”. Then, create a table named “Orders”. In the Orders table, create the following fields:

• OrderID (Primary Key)
• CustomerID
• OrderDate
• ShipDate
• ShipVia
• Freight
• SalesTax

Next, create a second table named “OrderDetails”. In the OrderDetails table, create the following fields:

• OrderDetailID (Primary Key)
• OrderID (Foreign Key)
• ProductID
• UnitPrice
• Quantity
• Discount

Now, we will create a query to join the Orders and OrderDetails tables. In the query designer, add the Orders table and the OrderDetails table. Join the OrderID field in the Orders table to the OrderID field in the OrderDetails table. Then, close the query designer and save the query as “qryOrders”.

Next, we will create a form based on the qryOrders query. In the Form Design Tools toolbar, click on the “Create Form in Design View” button. In the Form Design window, add the following fields from the qryOrders query:

• OrderID
• CustomerID
• OrderDate
• ShipDate
• ShipVia
• Freight
• SalesTax

Then, add a subform to the form. In the Subform/Child Data section of the toolbox, click on the “Subform/Subreport” button. Draw a rectangle on the form to create the subform. In the Subform Wizard, select the qryOrders query as the data source for the subform. Then, select the fields that you want to display in the subform:

• OrderDetailID
• ProductID
• UnitPrice
• Quantity
• Discount

Click “Finish” to close the Subform Wizard. Save the form as “frmOrders”.

Test the form by clicking on the “Form View” button in the Form Design Tools toolbar. Add a few records to the form to test the subform.

4. In the design view, click on the toolbox and then select the Subreport tool .
5. Draw the subreport on the design surface.
6. In the Property Sheet, click on the Data tab.
7. In the Control Source property, click the drop-down arrow and select the query that you want to use for the subreport.
8. In the Link Master Fields property, click the drop-down arrow and select the field in the main report that you want to use to link the two reports.
9. In the Link Child Fields property, click the drop-down arrow and select the field in the subreport that you want to use to link the two reports.
10. Click on the Format tab.
11. In the Height property, enter the desired height of the subreport.
12. In the Width property, enter the desired width of the subreport.
13. In the Horizontal Alignment property, select the desired alignment.
14. In the Vertical Alignment property, select the desired alignment.
15. Click on the Run icon on the toolbar to preview the report.