C
CuriousMark
How do I code for a text box on a continuous form that lists the record
number (or row number) of the corresponding record?
number (or row number) of the corresponding record?
<snip>CuriousMark said:Thanks Tony. The list shows the results of a query, sorted by date
ascending.
I am not showing the autonumber field. I want to add a column to the left
that numbers each record in order, from 1 to n, where n is the number of
records returned by the query. Basically, a numbered list.
CuriousMark said:How do I code for a text box on a continuous form that lists the record
number (or row number) of the corresponding record?
Albert D. Kallal said:CuriousMark said:How do I code for a text box on a continuous form that lists the record
number (or row number) of the corresponding record?
You can put the follwing code in the orm:
Function Rpos(vId As Variant) As Long
Rpos = 0
If IsNull(vId) = False Then
Me.RecordsetClone.FindFirst "id = " & vId
If Me.RecordsetClone.NoMatch = False Then
Rpos = Me.RecordsetClone.AbsolutePosition + 1
End If
End If
End Function
Then, you can put a un-bound text box in the continoues form,and
=(rpos([id]))
The above assumes you have a key field called id. It also assumes dao.