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

Row number for Access Report 1

Status
Not open for further replies.

mok44

MIS
Sep 3, 2002
36
US
How do I add a row number to a report?
I want to add a field in addition to my report fields that will contain a sequence starting at 1 for each row displayed in my report.
Thank you
 
Create a textbox control in your Detail Section of the report and name it RecNumber. Update it's Format property with #,##0 Open the Forms code window. Put the following code at the Report declarations level:
Dim vRecNumber As Long

Put the following code in the Detail Sections OnFormat event procedure:
vRecNumber = vRecNumber + 1
Me![RecNumber] = vRecNumber


Your report will now have an incrementing control starting with 1 without any gaps through the number of rows printing in the Detail Section.

If you need further help just respond back with questions.

Bob Scriver
 
Or, you could add a textbox to your detail section whose:

Control source is set to =1
and
Running Sum property is set to Over All

 
CosmosKramer: Love your handle. Your entry must be magnificant. I also like your solution. Much easier than mine. I learned something new already today so the day is a successful one.

Have a Star!!!!!!![2thumbsup] Bob Scriver
 
Thanks Bob.....All we can do is to be Masters of our own domain!!

P.S. I can't make a living off MoviePhone forever........
 
I used your solution in 2 subreports and it works great! Thank you both very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top