Line Numbering in continuous forms mode

  • Thread starter Thread starter Tim
  • Start date Start date
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
 
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.
 
Back
Top