Continuous form / sequential numbering

O

Opal

I am running Access 2003 and want to set up something on
a continuous form in a multi-user environment simply for
the user (aesthetic) when entering data.

User must enter countermeasures on a subform,
he can enter a maximum of 5 and I have a code
running on the subform:

Private Sub Form_Current()
LimitRecords Me, 5 ' allow at most 5 records
End Sub

What I want to do, is for each record added (1 to 5)
they are numbered on the form. I did some hunting
and found:

Private Sub Form_BeforeInsert(Cancel As Integer)
Dim x As Integer

With Me.RecordsetClone
'.MoveLast
x = .RecordCount
End With
Me.Line = x + 1

End Sub

but with each new record the number on all the
records changes. Can anyone suggest
something that will work? I want to see on
the subform:

Line CM
1 Countermeasure 1
2 Countermeasure 2
....
 

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