Design View option on the Queries window. When the Design view comes up,
select the Colors table to add to the query.
At this stage the Design view is set to create a standard select query. To change it
to an update query, click the Query menu, and then select Update Query. Figure 4-6
shows the menu option.
Note that in the Design View grid, a new row option has become available—
Update To. Add the Name field from the Colors table to the Design grid.
For this example, we want to update the Fuscia color to Vibrant Fuscia. In the
Update To row field for the Name column, type Vibrant Fuscia. If the query were
run now, then all of the color records would be updated. That isn’t what we want—
we only want Fuscia updated.
We have a couple of options here. The first is to add the ColorID field into
the grid and set a criteria of 2 so that only records with an ID of 2 (Fuscia) are
updated. Or, we can get a little more creative and use the SQL Like command. In
this case, we want to update all color names where the name is like Fuscia. So, for
the Name criteria we will enter the following SQL snippet:
Like “*Fuscia*"
CHAPTER 4: Building Advanced Queries with the Query Design View
77
Win&Mac / Microsoft Office Access 2003 Professional Results / Jerke / 222965-9 / Chapter 4
FIGURE 4-6
Setting the query to an update query
P:\010Comp\Win&Mac\965-9\ch04.vp
Wednesday, August 06, 2003 10:17:25 AM
Color profile: Generic CMYK printer profile
Composite Default screen
Previous Main Next