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 Westi 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.

ITbeast

IS-IT--Management
Jul 25, 2006
67
US
I have a report that I want to include line numbers on. I tried to use a text box and put the expression =1 in the control source, then select the "Running Sum" option which works great for page 1, but not after that. any ideas?
 
Running sum doesn't care what page it is displaying. What makes you think it isn't working? Are you using a subreport? What is your Running Sum property value?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Yes, I'm awake that running sum doesn't care what page number it is. I was just saying that was my only idea so far, do you have another one? Right now my running sum value is "Over Group"

I guess my main question is can i iterate a repeated value for a specific page?
 
ITBeast,
Your only specification is "I want to include line numbers" which a running sum "Over All" will create. Did you have a need to start back at 1 for each group or each page? Are groups by page?

Is your detail section allowed to grow?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Yes dhhookom, I need to start over at 1 on top of every page. It's not neccesssarily grouped by page, but the specifications of the project require each page to be numbered the same.

My detail section is not allowed to grow.

Thanks for the help, i appericate it
 
It would have helped if we had known your specs from your first post.

Don't display any numbering in bound controls. Use the Print method of the report to display the numbers with code in the On Page event. Your code may vary depending on visible sections.

Code:
Private Sub Report_Page()
    Dim intNumLines As Integer
    Dim intLineNumber As Integer
    Dim intTopMargin As Integer
    Dim intLineHeight As Integer
    Dim intLineNum As Integer
    intNumLines = 25
    
    intTopMargin = Me.Section(3).Height
    intLineHeight = Me.Section(0).Height
    For intLineNum = 0 To intNumLines - 1
        Me.FontSize = 12
        Me.FontBold = True
        Me.ForeColor = vbBlue
        Me.CurrentY = intTopMargin + (intLineHeight * intLineNum)
        Me.CurrentX = 72
        Me.Print intLineNum + 1
    Next
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top