Microsoft KB Archive/296246

= How to print line number for each record/group on a report in Access 2002 =

Article ID: 296246

Article Last Modified on 8/13/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q296246



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



For a Microsoft Access 97 version of this article, see 98790.

For a Microsoft Access 2000 version of this article, see 209567.



SUMMARY
You can add a text box control that prints a sequential number for each record to the detail section of a report. You can reset this number so that a separate set of numbers is printed for each group of records. This article explains how to do this by modifying a report in the sample database Northwind.mdb.



Printing a Sequential Number for Each Record to the Detail Section of a Report
If you want to print an incremental counter for each record in a report group, add an unbound text box control to the detail section of the report. To begin the sequence with the number 1, set the ControlSource property to =1, and then set the RunningSum property to Over Group.

To print an incremental counter for each record in a report group, follow these steps:  In the Database window, open the Products By Category report in Design view.  Add the following text box control before the Product Name control in the detail section:   Object: Text Box --  Name: MyLineNumber ControlSource: =1 RunningSum: Over Group  Preview the report. Note that each group's records are sequentially numbered, beginning with the number 1.

Resetting the Number
You can also increment the counter number for each group in the report by changing the RunningSum property to Over All. To do this, replace step 2 above with the following step:

  Add the following text box control before the Category Name control in   the Category Name Header section:   Object: Text Box Name: MyLineNumber2 ControlSource: =1 RunningSum: Over All Repeat step 3 above. Note that each individual record now prints a unique sequential number.

Additional query words: OfficeKBHowTo reports sequential line inf

Keywords: kbhowto kbprint kbreport KB296246

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.