=RowNum([Form]) - equivalent in a report?



I am running Access 2003 and found the following function:

Public Function RowNum(frm As Form) As Variant
On Error GoTo Err_RowNum
'Purpose: Numbering the rows on a form.
'Usage: Text box with ControlSource of: =RowNum([Form])

With frm.RecordsetClone
.Bookmark = frm.Bookmark
RowNum = .AbsolutePosition + 1
End With

Exit Function

If Err.Number <> 3021& Then 'Ignore "No bookmark" at new row.
Debug.Print "RowNum() error " & Err.Number & " - " &
End If
RowNum = Null
Resume Exit_RowNum
End Function

Which works really well on my forms. Is it possible to adapt
something similar
to use on a report?



Add a Text box.

Make its control source property =1

Make its Running Sum property Over All

That's all.

Vanderghast, Access MVP


in Report You can use Running Sum Property, But in Form You cannot use running Sum, So You need to use Code Above-mention

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

=RowNum([form]) problem 2
Numbering records 2
Item numbers? 2
RowNum using Numbers 2 Roman code 6
Modules dont work any more? 5
Subform Navigation 2
Problem With IsFormLoaded Do Loop Code 1
carry over 1