28

Creating Delete Queries

Delete queries are used to remove records from a table. You can use criteria in Delete queries to limit the records that are to be removed; otherwise each time a Delete query is executed all records in the table will be deleted. For example, assume you have a Customers table and you want to remove one of the customer records from it. You could use a Delete query to programmatically remove the record from the table. Delete queries can be an important piece of your database application, and at the same time, they can be one of the most destructive tools allowed in a database. With the exception of import and export operations, Delete queries should rarely be used in a properly normalized database application. We highly recommend always creating a complete backup of the database before ever running a Delete query, because once it has been executed, the records will be gone forever!

LESSON SETUP

This lesson discusses the basics of creating Delete queries. You should be familiar with creating database objects and working with tables and queries using Access 2010 to complete this lesson successfully.

DELETE QUERIES IN ACCESS

Access 2010 allows Delete query objects to be created and executed in a database application. Because Delete queries are considered Action queries and can modify the data stored in the tables, you must trust the database file, so that Access will run in Enabled mode before you can execute a Delete query properly. Creating Delete queries ...

Get Microsoft® Access® 2010 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.