Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 20: Advanced Access Report Techniques


713


To emphasize the alphabetical grouping, a text box containing the first character for each group
has been added to the report (see rptSalesJanuaryAlpha2 in Figure 20.5). Although the data
set in this example is rather small, in large reports such headings can be useful.

FIGURE 20.5

An alphabetic heading for each customer group makes the rptSalesJanuaryAlpha2 report easier to read.


Adding the text box containing the alphabetic character is easy:


  1. Choose View ➪ Design.

  2. Choose View ➪ Sorting and Grouping.


The Group, Sort, and Total dialog box appears.



  1. Click on More, and ensure that With a Header Section is selected.


This action adds a band for a group based on the CompanyName information (if it wasn’t
already there).



  1. Expand the CompanyName group header and add an unbound text box to the
    CompanyName group header.

  2. Set the text box’s Control Source property to the following expression:


=Left$([CompanyName],1)


  1. Set the other text box properties (Font, Font Size, and so on) appropriately.

  2. While you’re grouping on the first character of the company name, you still need to
    ensure that company names are sorted correctly. Click Add a Sort and select the
    CompanyName field again. Click More to ensure that the entire field is going to be
    sorted, and that no header section will be added.


When you’re done, the report in Design view should appear as shown in Figure 20.6.

Free download pdf