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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbering

Status
Not open for further replies.

MTBChik

Technical User
Jun 19, 2001
58
US
I have a report that I need to automatically number the lines for each detail record.

Here is what I have so far:
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
lngPlace = 0
End Sub

And here's where the detail gets counted:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

lngPlace = lngPlace + 1
Me.txtPlace = lngPlace

End Sub

This is working just great except when the number of records exceeds the number of lines on the page and goes to the next page. For example, I can get 60 lines per page, but when it goes to the next page, the first item number is 62 NOT 61.

Any ideas?
 
Hi. If you creat a text box, set it's control source to =1, and set running sum to over all (under the data tab), it handles it for you.

Hope I am not missing something.

ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
You might try using Mod to test for page breaks, such as:
Code:
  lngPlace = lngPlace + 1

  If (lngPlace Mod 60) = 0 Then
    Me.txtPlace = 60
  Else
    Me.txtPlace = (lngPlace Mod 60)
  End If


VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Sorry for the delay in getting back to you. Have been on the road for far too long.

I couldn't get the MOD function to work, but setting the textbox to OverGroup worked great!

Thanks to you both!

__~o
`\<,
(_)/(_)
MTBChick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top