Print part of a string as group header

Microsoft Office Access 2003

Show All Show All

Print part of a string as group header

  1. Open a grouped report in Design view.
  2. Click Sorting And Grouping Button image on the toolbar, and make sure that the properties in the Sorting And Grouping box are set as follows:
    Property Setting
    GroupOn Prefix Characters
    GroupInterval (Type the number of characters)
  3. Click the Text Box Button image tool on the toolbox and click the group header.
  4. Select the control and then click Properties Button image on the toolbar.
  5. In the ControlSource property box, type the expression (by using the Left or Right function) that will extract the appropriate characters. In a report in a Microsoft Access database (.mdb), you can click the Build button Button image to use the Expression Builder to create the expression.

    Show Example of extracting the first alphabet of a string

    If you're tracking office equipment and furniture, and the asset number includes an alphabetic code for distinguishing one type of asset from another (for example, FR100 for furniture), you could use an expression similar to the ones in the following table.

    This expression Returns
    =Left([AssetCode], 2) FR
    =Right([AssetCode], 3) 100

Note  The Alphabetical List of Products report in the Northwind sample database has an example of printing the first letter of each group of products in the group header. To view this report, open the Northwind database in the Samples subfolder of your Office folder, and then open the Alphabetical List of Products report in Design view.