Microsoft Office Tutorials and References
In Depth Information
Six Kinds of Queries
the Format drop-down list and choose the correct format for your new,
Be careful about running delete queries. A delete query deletes records and
doesn’t give you the opportunity to get the records back if you change your
mind about deleting them. If used skillfully, however, a delete query is a
great way to purge records from more than one database table at once. Back
up your database file before running a delete query. Edith Piaf didn’t regret
her delete query, but you might regret yours.
To run a delete query, start a new query, and in on the (Query Tools) Design
tab, click the Delete button. Then make as though you were running a select
query but target the records you want to delete. Finally, click the Run button
to run the query.
You can delete records from more than one table as long as the tables are
related and you chose the Cascade Delete Related Records option in the Edit
Relationships dialog box when you linked the tables. (See Chapter 2 of this
mini-book for advice about forging relationships between tables.)
To preview the records that will be deleted before you run the delete query,
switch to Datasheet view (click the View button). Those records you see?
The delete query will delete them if you click the Run button.
An update query is a way to reach into a database and update records in
several different tables all at one time. Update queries can be invaluable, but as
with delete queries, they can have untoward consequences. Back up your
database before you run an update query; then follow these steps to run it:
1. Starting in Design view, go to the (Query Tools) Design tab and click
the Update button.
2. In the field with the data that needs updating, enter text or a value in
the Update To line. You can even enter another field name in square
What you enter in the Update To line replaces what’s in the field of the
records you collect.
3. Click the Run button.
To update records in more than one table, you must have chosen the
Cascade Update Related Fields option in the Edit Relationships dialog box
when you linked the tables. (See the section in Chapter 2 of this mini-book
about forging relationships between tables.)