Prev: Error 3075 Syntax Error
Next: Combo Box Data Row Source
From: Opal on 27 Feb 2010 14:11 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 ....
From: Opal on 27 Feb 2010 14:43 Nevermind, found http://www.lebans.com/rownumber.htm and it works.
|
Pages: 1 Prev: Error 3075 Syntax Error Next: Combo Box Data Row Source |