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 .
- Create a new query that contains the tables from which you want to delete records or set criteria.
How?
- In query Design view, click the arrow next to Query Type on the toolbar, and then click Delete Query.
- 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.
- 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.
- In the Criteria cell for the fields that you have dragged to the grid, type the criteria.
For information on specifying criteria, click .
- 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.
- Click Run on the toolbar to delete the records from the table on the "many" side.
- Select the field list for each table on the "many" side and press DELETE to remove it from the query.
- 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.