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!

counting records

Status
Not open for further replies.

everytime

Programmer
Feb 21, 2001
31
0
0
GB
I have a query that just pulls data from a table. I would like to add a count so that the first field in the query would say the number of the record i.e. 1, the second record 2 and so on. What do I need to put in the field to do that?

thx for any help
 
I haven't been able to successfully assign an autonumber in a query, but you can do it in the report by placing this code in the "on print" function of the appropriate section.

(my unbound Field name is called txtRank)

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Rank = Rank + 1
txtRank = Rank

End Sub


Hope that helps!

--Angela


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top