Delete records by using a query that includes both tables in a one-to-many relationship

Delete records by using a query that includes both tables in a one-to-many relationship

For information on important considerations when using a query that deletes records, click .

  1. Create a new query that contains the tables from which you want to delete records or set criteria.

    How?

  2. In query Design view, click the arrow next to Query Type on the toolbar, and then click Delete Query.

  3. From the table with related records (on the "many" side of the one-to-many relationship), drag the asterisk (*) from the field list to the query design grid.

    From appears in the Delete cell under this field, as shown in the following illustration.

  4. From the primary table (on the "one" side of the one-to-many relationship), drag to the design grid the fields on which you want to set criteria.

    Where appears in the Delete cell under this field, as shown in the following illustration.

    Specifying criteria for deleting records from both sides of a one-to-many relationship

  5. In the Criteria cell for the fields that you have dragged to the grid, type the criteria.

    For information on specifying criteria, click .

  6. To preview the records that will be deleted, click View on the toolbar. To return to query Design view, click View on the toolbar again. Make any changes you want in Design view.

  7. Click Run on the toolbar to delete the records from the table on the "many" side.

  8. Select the field list for each table on the "many" side and press DELETE to remove it from the query.

  9. With just the primary table remaining in the query and the field on which you want to set criteria in the design grid, click Run again. Microsoft Access deletes the specified records from the "one" table.

Note   To stop a query after you start it, press CTRL+BREAK.