how to create a subform in access

Mastering Access: Step-by-Step Guide to Creating Subforms

By Laura Walker
AD

Creating a subform in Microsoft Access involves binding a parent form to a subreport or subdatasheet. By doing so, you can manage related data in a compact, user-friendly layout. Let's step through the process of creating a subform, optimizing your Access database, and enhancing its functionality.

First, ensure that you have a primary table (parent) and a related table (child) created in your database. For instance, a 'Customers' table as the parent and an 'Orders' table as the child, where each customer can have multiple orders. Now, let's dive into creating the subform.

Designing Your Subform

The first stage in creating a subform involves setting up the appearance and behavior of your subform. In this section, we'll focus on designing the layout and binding your child table.

AD
Access Template Tutorial
Access Template Tutorial
Access 2010 Tutorial Creating a Form in Design View Microsoft Training Lesson 10.9
Access 2010 Tutorial Creating a Form in Design View Microsoft Training Lesson 10.9
Microsoft Access Beginner 1: How To Build a Customer Database, Enter Data, Sort, Filter, and Create Forms in Microsoft Access - Computer Learning Zone
Microsoft Access Beginner 1: How To Build a Customer Database, Enter Data, Sort, Filter, and Create Forms in Microsoft Access - Computer Learning Zone

1. Open your main form (e.g., 'Customers') in Design View and click on 'Form Controls' in the Design tab. Select 'Subform/Subreport' and drag it onto your form to add a new subform.

Setting the Record Source

To link the subform to your child table, you'll need to set the Record Source property. Click on your newly added subform, then, in the Property Sheet ( press F4), navigate to the 'Data' section. In the 'Record Source' field, enter the name of your child table (e.g., '[Orders]') and press Enter.

How to create a Tabbed Form in Access
How to create a Tabbed Form in Access
Access 2016: Create a Table
Access 2016: Create a Table
MS Access Made Easy | Beginner's Guide to Database Management
MS Access Made Easy | Beginner's Guide to Database Management

This tells the subform to display records from the 'Orders' table. However, we still need to link this data to the parent form.

Creating the Link Between Forms

With the Record Source set, the next step is to create a link (or Join) between the parent and child forms. In the 'Property Sheet', navigate to the 'Event' section. Find the 'On Current' event and set the 'Value' field to '=Forms![Customers]![CustomerID]'.

AD

This则 creates a relationship between the 'Customers' and 'Orders' forms based on the 'CustomerID' field. Essentially, the subform will display records from the 'Orders' table where the 'CustomerID' matches the 'CustomerID' in the current 'Customers' form.

Microsoft Access Beginner 1 - Computer Learning Zone
Microsoft Access Beginner 1 - Computer Learning Zone
Database First Steps - Access 101 - Create your first database
Database First Steps - Access 101 - Create your first database
Master Microsoft Access : A Free Guide to Database Success in 2025
Master Microsoft Access : A Free Guide to Database Success in 2025
a man in a black shirt with the words microsoft access how to make a dashboard
a man in a black shirt with the words microsoft access how to make a dashboard
How to use Microsoft Access - Beginner Tutorial
How to use Microsoft Access - Beginner Tutorial
How to sum column in listbox using forms MS access VBA
How to sum column in listbox using forms MS access VBA

Customizing Your Subform's Appearance

After setting up the basic functionality, you can enhance the appearance of your subform for better usability. Here, we'll explore arranging controls and customizing the look and feel.

1. **Arranging Controls**: In your subform's Design View, use the 'arriange' button in the 'Tools' tab to organize your controls. This ensures that the subform fits neatly within the main form and displays the required fields efficiently.

AD

Setting Subdatasheet Properties

To further customize your subform, adjust its properties in the Property Sheet. Change the 'Border Style' to 'None' to create a seamless integration with the main form. Adjust the 'Back Color' and 'Alternate Back Color' to style the subform's background.

Progress Bars, Recordsets, Elapsed Time, Abort
Progress Bars, Recordsets, Elapsed Time, Abort
Forms, Security Warnings, Relationships, Combo Boxes
Forms, Security Warnings, Relationships, Combo Boxes
This Access Database Tutorial Will Help You Get Started
This Access Database Tutorial Will Help You Get Started

Moreover, adapt the 'Form View' settings to control the initial view state (e.g., ' Continuous' or 'Dynaset'), allowing users to print, delete, or append records directly from the subform.

AD