Database Reference
In-Depth Information
SEE ALSO For information about backing up a database, see “Preventing database
problems” in Chapter 12, “Protect databases.”
In this exercise, you'll create a delete query that will remove the records of discontinued
products from a table.
SET UP You need the GardenCompany07 database you worked with in the preceding
exercise to complete this exercise. If necessary, open the database. Then follow the steps.
1
Open the Query Designer , and add the Products table to the query.
2
In the Products field list, double-click * (the asterisk) to enter Products.* in the Field
row and Products in the Table row of the first column of the design grid.
TIP Double-clicking the asterisk in the field list is a quick way to move all the fields
to the query, without each field taking up a column in the design grid and possibly
making it necessary to scroll from side to side to view them all. However, selecting
all the fields in this way prevents you from setting Sort, Show, and Criteria values for
individual fields. To set these values, you have to add the specific fields to the design
grid, thereby adding them twice. To avoid displaying the fields twice in the results,
clear the check box in the Show row of the duplicate individual fields.
7
3
In the Products field list, double-click Discontinued to copy it to the next available
column in the design grid.
Let's convert this select query to a delete query and then use criteria to identify the
records we want to delete.
4
On the Design tool tab, in the Query Type group, click the Delete button to convert
this select query to a delete query.
In the query design grid, the Sort and Show rows disappear, and a Delete row appears.
In the first column, which contains the reference to all fields in the Products table,
the Delete row contains the word From , indicating that this is the table from which
records will be deleted. When you add individual fields to the remaining columns,
as you did with the Discontinued field, the Delete row displays Where , indicating
Search WWH ::




Custom Search