A Delete query enables you to delete large quantities of informationquickly:
Important:
If you want to delete data from related tables, you may need to edit thetable relationships so that EnforceReferential Integrity, as well asCascade Delete Related Records, is selected.This ensures that related data is deleted on the one-and-many side ofthe relationship. If, however, you are just deleting records on the manysides of the relationship, you do not have to enforce referentialintegrity.
If you want to delete data from related tables, you may need to edit thetable relationships so that EnforceReferential Integrity, as well as
- Using the ElkAdmin-DeleteMe.accdb database from theprevious example, select the QueryDesign icon located on the
Queries group of the Create tab.
- When prompted by the Show Tabledialog box, double-click on the
ElkPupilsTbl table to add it to the querygrid. Click Close to move to the querygrid. - Click the Delete icon, whichappears in the Query Typegroup. Notice that the grid updates to display the
Delete: row. Double-click on the Code field from the table to add it to thegrid. - Enter =427 into the
Criteria: row, as we would like to deleteall instances of the surname MEAKER,who belongs to code 427, as the childno longer attends the school. This information can be seen in thefollowing screenshot:

- A dialog box will appear, warning you that one row will bepermanently deleted from the table. Click
Yes to continue, after which code 427 is removed from the database. - Save the query, should you wish to run it at another time. The savedquery will be visible in the Navigation Pane, under the
Queries group.