Print part of a string as group header
- Open a grouped report in Design view.
- Click Sorting And Grouping
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) - Click the Text Box tool on the toolbox and click the group header.
- Select the control and then click Properties on the toolbar.
- 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 to use the Expression Builder to create the expression.
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.