Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset row numbering on each page?

Status
Not open for further replies.

trScott

Technical User
Dec 13, 2004
31
0
0
US
I have a very simple report. It is just a large number of consecutive rows listing a persons name and one identification number we use internally. I'm numbering each row consecutively (running sum), but I need to reset the running sum back to 0 on each page (results in a series of pages with rows 1, 2, ...25 on each page). It is probably dirt simple, but I'm not sure how to go about it.

Thanks!
 

First you need to figure out how many lines you are getting on each page.

the number I used below to indicate the number of lines on a page = 18.

edit the red line below to make the 18 = the number of lines you are getting on each page.

-------------------------------------------------


Add an unbound text box to the Detail section where you want it to print.
Set the Running Sum to No.
Name it txtCount.

In the Report Header OnFormat event code:
[txtCount] = 0


Now code the Detail Format event to count 1 higher than you want:


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intLineCount as integer
intLineCount = 18 ! <-edit this number

[txtCount] = [txtCount] +1
If [txtCount] = intLineCount Then [txtCount] = 0
End Sub


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top