Microsoft Office Tutorials and References
In Depth Information
To modify the copied query, you need to open it in Design view.
3. In the Queries group on the Navigation Pane, right-click
qryHollandRockfordSaugatuckCustomers to select it and display the
4. Click Design View on the shortcut menu to open the query in Design view, and
then close the Navigation Pane.
You need to delete the existing condition from the Phone field.
5. Click the Phone Criteria text box, press the F2 key to highlight the entire condi-
tion, and then press the Delete key to remove the condition.
Now you can enter the criteria for the new query using the In comparison
operator. When you use this operator, you must enclose the list of values you want
to match within parentheses and separate the values with commas. In addition, for
fields defined using the Text data type, you enclose each value in quotation marks,
although Access adds the quotation marks if you omit them. When using the In
comparison operator for fields defined using the Number or Currency data type,
you don’t enclose the values in quotation marks.
6. Right-click the City Criteria text box to open the shortcut menu, click Zoom to
open the Zoom dialog box, and then type In ("Holland","Rockford",
"Saugatuck") . See Figure 5-6.
Record selection based on matching field values to a list of values
After clicking in a text box,
you can also open the
Zoom dialog box for that
text box by holding down
the Shift key and pressing
the F2 key.
7. Click the OK button to close the Zoom dialog box, and then save and run the
query. Access displays the recordset, which shows the 13 records with Holland,
Rockford, or Saugatuck in the City field.
8. Close the query.
Sarah asks her assistant to contact Belmont Landscapes customers who are not in Hol-
land, Rockford, and Saugatuck. You can provide Sarah with this information by creating a
query with the Not logical operator.
Using the Not Operator in a Query
The Not logical operator negates a criterion or selects records for which the designated
field does not match the criterion. For example, if you enter Not “Holland” in the Criteria
text box for the City field, the query results show records that do not have the City field
value Holland, that is, records of all customers not located in Holland.