Microsoft Office Tutorials and References
In Depth Information
less than $10,000 or if the SigningDate field value is between 1/1/2011 and 3/1/2011.
These are two of the conditions needed to answer Taylor’s question. You could modify the
qrySmallContractsOrWinterSignings query in Design view to further restrict the records
selected to customers located only in Grand Rapids and East Grand Rapids. However, you
can use the AutoFilter feature to choose the city restrictions faster and more flexibly. You pre-
viously used the AutoFilter feature to sort records, and you previously used Filter By Form
and Filter By Selection to filter records. Now you’ll show Taylor how to use the AutoFilter
feature to filter records.
To filter the records using an AutoFilter:
1. Open the qrySmallContractsOrWinterSignings query in Design view, and then
close the Navigation Pane.
The <10000 condition for the ContractAmt field selects records whose contract
amounts are less than $10,000, and the Between #1/1/2011# And #3/1/2011# con-
dition for the SigningDate field selects records whose contracts were signed during
the first two months of 2011. Because the conditions are in two different rows, the
query uses the Or logical operator. If you wanted to answer Taylor’s question in
Design view, you would add a condition for the City field, using either the Or logi-
cal operator— ”Grand Rapids” Or “East Grand Rapids” —or the In comparison
operator— In (“Grand Rapids”,”East Grand Rapids”) . You’d place this condition
for the City field in both the Criteria row and in the or row. The query recordset
would include a record only if both conditions in either row are satisfied.
Instead, you’ll show Taylor how to choose the information she wants using an AutoFilter.
2. Run the query, and then click the arrow on the City column heading to display the
AutoFilter menu. See Figure 5-8.
Using an AutoFilter to filter records in the query recordset
for current field
The AutoFilter menu lists all City field values that appear in the recordset. A check
mark next to an entry indicates that records with that City field value appear in
the recordset. To filter for selected City field values, you uncheck the cities you
don’t want selected and leave checked the cities you do want selected. You can
click the “(Select All)” check box to select or deselect all field values. The “(Blanks)”
entry includes null values when checked and excludes null values when unchecked.
(Recall that a null field value is the absence of a value for the field.)