Microsoft Office Tutorials and References
In Depth Information
Limiting Records with Criteria Expressions
1. In Design view, right-click anywhere in the column that contains the
field you want to format and then choose Properties from the
contextual menu.
If a property sheet is displayed already, just clicking the field displays
the properties for that field.
2. Click the Format property and then click the arrow to display a
dropdown menu of format options.
3. Choose a format option.
The format options in the property sheet are exactly the same as the options
for the Format property in the field properties for a table, and you can use
them exactly the same way. When you format a field in a query, however,
you affect how that field appears only in the query datasheet. (Formatting
fields is covered in detail in Book II, Chapter 2.)
Limiting Records with Criteria Expressions
In addition to using queries to select only a few fields to show, you may use
queries to display a limited selection of records. Criteria enable you to limit
the records that the query displays. You use the Criteria and Or rows in the
design grid to tell Access exactly which records you want to see.
Book III
Chapter 1
Querying by example
Querying by example makes defining criteria easy: If you tell Access what
you’re looking for, Access goes out and finds it. If you want to find values
equal to 10, the criterion is simply 10. Access finds records that match —
that are equal to 10.
The most common type of criterion is a logical expression, which gives a
Yes or No answer. Access shows you the record if the answer is Yes but
doesn’t show the record if the answer is No. The operators commonly used
in logical expressions include <, >, AND, OR, and NOT.
Although uppercase is used to distinguish operators and functions, case
doesn’t matter when you type in the design grid.
If you want to find all the addresses in California, the criterion for the State
field is simply the following:
You may want to add another criterion in the next line (OR) to take care of
different spellings, as follows:
Search JabSto ::

Custom Search