Microsoft Office Tutorials and References
In Depth Information
5. Click CustomerID in the Fields in 'qryCustomersByName' list box, click CustomerID in
the Fields in 'tblContract' list box, click the button to connect the two selected
fields, and then click the Next button to open the next Find Unmatched Query Wizard
dialog box, in which you choose the fields you want to see in the query recordset. Oren
wants the query recordset to display all available fields.
6. Click the button to to move all fields from the Available fields list box to the
Selected fields list box, and then click the Next button to open the final dialog
box, in which you enter the query name.
7. Type qryInactiveCustomers , be sure the option button for viewing the results is
selected, and then click the Finish button. Access saves the query and then dis-
plays two records in the query recordset. See Figure 5-28.
Query recordset displaying customers without contracts
Figure 5-28
The query recordset includes information for the two inactive customers. Oren will
use this information to contact these customers to see if they have any current or
future landscaping needs.
8. Close the query.
Next, Oren wants Taylor to contact those customers who have the highest contract
amounts to make sure that Belmont Landscapes is providing satisfactory service. To dis-
play the information Taylor needs, you will create a top values query.
Creating a Top Values Query
Whenever a query displays a large group of records, you might want to limit the number
to a more manageable size by displaying, for example, just the first 10 records. The Top
Values property for a query lets you limit the number of records in the query results. For
the Top Values property, you can click one of the preset values from a list, or enter either
an integer (such as 15, to display the first 15 records) or a percentage (such as 20%, to
display the first fifth of the records) to find a specific number of records.
Suppose you have a select query that displays 45 records. If you want the query
recordset to show only the first five records, you can change the query by entering a Top
Values property value of either 5 or 10%. If the query contains a sort and the last record
that Access can display is one of two or more records with the same value for the pri-
mary sort field, Access displays all records with that matching key value.
Creating a Top Values Query
| Reference Window
• Create a select query with the necessary fields and sorting and selection criteria.
• In the Query Setup group on the Query Tools Design tab, enter the number of records (or
percentage of records) you want selected in the Return (Top Values) text box.
Search JabSto ::

Custom Search