Microsoft Office Tutorials and References
In Depth Information
Deleting Lots of Records with Delete Queries
2. Drag the * option from each field list in the top half of Design view
to the design grid to display all fields from the table(s) containing
records you want to delete.
Using the * option allows you to view all fields in the table. When you
change the query to a delete query, only the * allows you to display
fields that aren’t being used for criteria.
3. Add fields that you have criteria for to the design grid and then define
4. Click the View button on the toolbar to view the datasheet.
The records you see should be the records that you want the delete
query to delete. If you see records that shouldn’t be deleted, or if you
don’t see records that you do want to delete, refine your query
definition, and repeat until the query produces the correct records.
5. Change the query type to a delete query by clicking the Delete button
in the Query Type group on the Query Tools Design tab of the Ribbon.
When you change the query type from select to delete, Access changes
the rows in the design grid. The Sort and Show rows are removed, and
the Delete row is added.
6. Choose a value for the Delete row (if it’s not set automatically) from
the drop-down menu:
a. Set the fields that you want to view to the From option.
b. Set the fields that define criteria to the Where option.
Figure 3-9 shows an example of a delete query that deletes records with
the ProductID value of 35 from the Order Details and Products tables.
Note that when you view the datasheet, you’re seeing data from two
different tables. All that data will be deleted, so data will be deleted from