Group records by the first n characters in a text value on a data access page

Group records by the first n characters in a text value on a data access page

Learn about grouping records by the first n (or prefix) characters.

  1. Open the data access page in Design view.

  2. Create a grouped data access page.

  3. Make sure there are two controls bound to the field you want to use to group by prefix characters.

  4. Make sure the control you want to use to group by prefix characters is selected.

  5. Click Promote on the toolbar.

    Microsoft Access adds a group header that contains an expand control, and a record navigation section that contains a record navigation control Access moves the control you grouped on to the group header.

  6. Click Sorting And Grouping on the toolbar to display the Sorting And Grouping box.

  7. Click the group record source that you want to group by prefix characters.

  8. Set the following properties:
  9. Specify the default sort order for the other group levels on the page.

Note   When you group on a control, Access creates an alias for the control by adding the prefix "GroupOf" to the control's name in the ControlSource property; for example, GroupOfProductName: ProductName. When you reference this control in an expression or in a property, you must use the alias.