Create a form with two subforms

Create a form with two subforms

Before using this procedure, make sure you've set up your table relationships correctly.

You can use this procedure to create a form and two subforms that have a one-to-many-to-many relationship. The main form has a one-to-many relationship with the first subform, and the first subform has a one-to-many relationship with the second subform.

  1. In the Database window, click Forms under Objects.

  2. Click the New button on the Database window toolbar.

  3. In the New Form dialog box, double-click Form Wizard in the list.

  4. In the first wizard dialog box, select the table or query for the main form. For example, suppose you want to create a Customers form that has two subforms — an Orders subform and an Order Details subform. Select the Customers table (the "one" side of the first one-to-many relationship).

  5. Double-click the fields you want to include from this table or query.

  6. In the same wizard dialog box, select the table or query for the first subform. Using the same example, select the Orders table (the "many" side of the first one-to-many relationship), and then double-click the fields you want to include from this table or query.

    Note   It doesn't matter which table or query you choose first.

  7. In the same wizard dialog box, select the table or query for the second subform. Using the same example, select the Order Details table (the "many" side of the second one-to-many relationship), and then double-click the fields you want to include from this table or query.

  8. When you click Next, if you set up the relationships correctly before starting the wizard, the wizard asks which table or query you want to view by. Using the same example, to create the Customers form, click By Customers.

  9. In the same wizard dialog box, select the Form With Subform(s) option.

  10. Follow the directions in the remaining wizard dialog boxes. When you click Finish, Microsoft Access creates a main form with two subform controls. It also creates two other forms, one for each subform.

Notes