Integrity and Cascade Delete Related Records Options For Each Relationship. To Do This
Integrity and Cascade Delete Related Records Options For Each Relationship. To Do This
If you want to only delete a few records, you don’t need a query. Just open the table in
Datasheet view, select the record that you want to delete, and then press DELETE.
When you want to either quickly delete a lot of data or delete a set of data on a regular,
a delete query might be useful because this query makes it possible to specify criteria to
quickly find and delete the data. Using a query can also be a timesaver because you can
reuse a saved query.
To remove entire records (rows) from a table or from two related tables simultaneously.
Delete queries remove all the data in each field, including the key value that makes a
record unique
Note: Before you delete any data or run a delete query, make sure that you have a
backup of your Access desktop database.
To create a delete query, click the Create tab, in the Queries group, click Query Design.
In the Show Table dialog box, double-click each table from which you want to delete
records, and then click Close.
The table appears as a window in the upper section of the query design grid. From the
list of fields, double-click the asterisk (*) to add all of the fields in the table to the design
grid.
Important: Use criteria to return only the records that you want to delete. Otherwise, the delete
query removes every record in the table.
If you want to delete data from several related tables, you must enable the Referential
Integrity and Cascade Delete Related Records options for each relationship. To do this:
Determine which records reside on the "one" side of the relationship and which reside on
the "many" side.
If you need to delete records on the "one" side of the relationship and the related records
on the "many" side, you enable a set of rules called Referential Integrity, and you enable
cascading deletes.
If you need to delete records only on the "one" side of the relationship, you first delete that
relationship, and then delete the data.
If you need to remove data only on the "many" side of the relationship, you can create and
run your delete query without having to change the relationship.