Deleting Records with a Query


graphics/06inf27.jpg

graphics/one_icon.jpg

Build a new query that contains the fields you want to search, but with no criteria entered.

graphics/two_icon.jpg

Open the Query menu and choose Delete Query .

graphics/three_icon.jpg

The design grid changes to include a Delete row. Set the query's criteria to return the records you want to delete (here, all records containing a Painting entry in the Product Type field).

INTRODUCTION

Suppose that you want to delete a certain product type from your inventory. Rather than deleting each instance of that product type in your database, you can use a delete query to both select the records to be deleted and then delete them.

graphics/06inf28.jpg

graphics/four_icon.jpg

Click the Save button on the Standard toolbar in the main Access window to save the query.

graphics/five_icon.jpg

Click the Run button.

graphics/six_icon.jpg

Access displays a message explaining that records will be deleted from the table. Click Yes to delete the records.

TIP

No Undo

You cannot undo this action, so be sure that the query you create will return the correct records and that you do, in fact, want to delete those records. If not, click No when prompted to confirm the deletion.

TIP

Other Query Types

You can also create queries to update records in a table. For example, you might use a query to update the price of a product instead of manually changing each record. You can also create a query to append (add) records to a database table. This is useful if you are working with multiple tables.



Easy Microsoft Office Access 2003
Easy Microsoft Office Access 2003
ISBN: 789729598
EAN: N/A
Year: 2003
Pages: 174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net