Using the Record Navigation Control's Filter and Sort Features Filtering by selection and sorting with the record navigation control is similar to using the filter and sort buttons of the toolbar in Datasheet view. The Quarterly Orders by Product query returns 947 rows, so filtering by Customer is useful to display a subset of the data for a single customer. You can also perform an ascending or descending sort on any field or column, and you can combine filters and sorting. Sorting and filtering records in DAP follows a pattern similar to that for conventional Access datasheets, forms, and reports. To experiment with the record navigation control's filter and sort features with the Quarterly Orders by Product page, do the following: Click the Customer column's text box to select the field, and then click the Filter by Selection button. When you apply a filter, the Toggle Filter Button changes to the depressed state. If you selected the first record for ANTON (Antonio Moreno Taqueri[as]a), the filter returns 13 records, as illustrated by Figure 24.24. Figure 24.24. Applying Filter by Selection to the underlying Recordset limits the records displayed in the section to the records that have the same value as the on you select in a text box. Test the filter by clicking the Last button. Click the Toggle Filter Button to remove the filter. The caption of the Record Navigation control confirms that the original 947 records are accessible. Click one of the Qtr field text boxes, and then click the Sort Descending button to display the largest dollar value of an order in that quarter of 1997. After you apply a sorting sequence, the sort buttons are disabled until you select another field. Figure 24.25 shows the result of a descending sort on the Qtr 1 column. Figure 24.25. Sorting operations on alphabetic and numeric fields of a page are identical to that for Datasheet or Form view. Why a customer in Copenhagen would purchase this much French wine from a U.S. firm is the second unsolved mystery of this chapter. Click to select the ProductName field, and then click the Apply Filter button to restrict the active records to a single product, Co[af]te de Blaye, for this example. Click the Qtr 2 field text box, apply a descending sort, and click the Last and First record buttons to display the largest order for the selected product in 1997Q2. Note Provide a hyperlinked help page for users of your DAP who don't have experience with Access filtering and sorting techniques. You can write your help pages with any HTML editing tool, such as FrontPage 2003. If only a brief explanation is required, you can add the text to the empty header element of the page. |