Line Numbering in continuous forms mode

T

Tim

To help a user keep her place when entering data taken
from a paper coding sheet, I'd like to number the rows in
my continuous-forms-mode subform (like turning line-
numbering on in a text editor):

1. [ ] [ ] [ ] [ ]
2. [ ] [ ] [ ] [ ]
3. [ ] [ ] [ ] [ ]
4. [ ] [ ] [ ] [ ]
....

Is there any way to get the current row's ordinal position
in the subform, so it can be written to a label?
TIA
 
A

Albert D. Kallal

You can put the follwing code in the sub form:

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.
 

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

Top