Flylib.com

Books Software

 
 
 

Using AutoPage to Create Columnar DAP

Using AutoPage to Create Columnar DAP

Access 2003's AutoPage feature generates a simple DAP from tables or queries. If all you need is a simple page that displays one record at a time, AutoPage is the fastest approach. To test the AutoPage feature, do the following:

  1. graphics/open_desigh_view.gif Click the Database window's Pages shortcut, if necessary, and click the New button to open the New Data Access Page dialog.

  2. Select AutoPage: Columnar in the list and select a table or query in the drop-down list. This example uses the Quarterly Orders by Product query (see Figure 24.22).

    Figure 24.22. The New Data Access Page dialog offers choices similar to those of the New Form dialog.

    graphics/24fig22.gif

  3. Click OK to generate the page. After a second or two, depending on the speed of your PC, the page opens in Page view without a title (see Figure 24.23). If you specified a default theme when testing the Page Wizard, the default theme is applied automatically to your page.

    Figure 24.23. The AutoPage: Columnar choice generates a simple page with a single navigation control for the table or query that you select.

    graphics/24fig23.gif

    Note

    The Quarterly Orders by Product page is read-only because its underlying summary query is read-only. All queries that return aggregate values, such as Jet crosstab queries, are read-only.

  4. Save the page as QuarterlyOrdersByProduct.htm in your working folder, and acknowledge the warning message.

Note

Microsoft's sample DAP have filenames that include spaces. Spaces in production Web page filenames are uncommon and can cause problems with some Web servers and browsers. DAP require IE 5+ for viewing and usually run from a Microsoft Web server, so spaces in file names aren't fatal. It's a good HTML programming practice, however, to remove spaces or other nonstandard punctuation (except hyphens) from .htm file names .


graphics/access_2002_new_icon.gif

Field labels in Access 2003 DAP display the caption of the underlying table; Access 2000 uses field names for the caption. The Product Name and Customer labels use the Caption property and don't have added colons. The remaining fields are query column names (without Caption property values) and have colons. The reason for omitting colons from Caption-based labels is a mystery.

Note

graphics/access_2002_new_icon.gif

The Quarterly Orders by Product query displays the CompanyName field of the Customers table in the Customer column of Datasheet view, but not in the Customer field of your AutoPage. Customer is a lookup field; lookup fields don't propagate to pages that you create with the Page Wizard or AutoPage feature. When you drag lookup fields from the Field List to a section, however, a lookup field substitutes a drop-down list for the standard text box. Access 2002 introduced automatic support for lookup fields by DAP.


Using the Record Navigation Control's Filter and Sort Features

graphics/filter_by_selection.gif graphics/sort_ascending.gif 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:

  1. graphics/filter_by_selection.gif 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.

    graphics/24fig24.gif

  2. graphics/apply_filter.gif Click the Toggle Filter Button to remove the filter. The caption of the Record Navigation control confirms that the original 947 records are accessible.

  3. graphics/sort_descending.gif 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.

    graphics/24fig25.gif

  4. graphics/apply_filter.gif 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.

  5. graphics/last_record.gif graphics/first_record_navigation.gif 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.