A Group Filter control is a drop-down list box with a Select Distinct clause, sorted in Ascending order for a specified field in the section's recordset. The Group Filter control controls the current recordset for that level of the hierarchy. By default, the Group Filter control has no value. This means that when you create a section with a Group Filter control on it, there are no records available until you select a value from the drop-down list. At this point, that level of the hierarchy is populated, and any children it may have are also populated.
This type of control can be compared to a combo box on a form that finds a record on that form based on the value selected in the combo box. The control itself is not bound to the underlying recordset; it merely provides you an interface for selecting records.
Each group or level of a data access page can contain a single Group Filter control. When you place a second Group Filter control in a section, the original control is "demoted" to a drop-down list. The properties that determine which drop-down list in a section, if any, are to be implemented as a Group Filter control are
Group Filter Control and
Group Filter Field. Although you can use a wizard to help you create a Group Filter control, you can also set these properties manually. You can access both properties through the
Sorting and Grouping dialog box.
To create a Group Filter control:- Open the sample database Northwind.mdb.
- Create a new data access page based on the Customers table.
- If the field list is not displayed, click Field List on the View menu.
- Add all the fields from the Customers table from the field list to the data access page.
- Right-click the CompanyName control on the data access page, and then click Promote on the shortcut menu.
- If the toolbox is not displayed, click Toolbox on the View menu.
- Click the Dropdown List control in the toolbox.
- With the Dropdown List control still selected in the toolbox,
right-click the Country field in the field list, hold down the right mouse button, and then drag the Country field from the field list to the Customers section of the data access page.
- When you drop the field on the data access page, a shortcut menu appears. On this shortcut menu, click Group Filter Control.
- On the View menu, click Page View. Note that all of the controls appear on the data access page, but that neither the input box, nor the drop-down list displays any data.
- In the drop-down list, select one of the countries. Note that the input box is populated with the first customer from this country and that the record navigation control displays Customers 1 of n, where n is the number of customers in this country.
With each change of the value in the Group Filter control, the currency of the section changes, as does the number of records in the navigation control.