Tim Bedborough
Registered User.
- Local time
- Today, 01:02
- Joined
- Nov 16, 2015
- Messages
- 42
Hi all
I have a 'to do' list (on a continuous form) where I want to change the order of things periodically. I am using an incremental numbering system using 10, e.g. item 1 = 10, item 2 = 20 and so on. If I need to squeeze something in I can use e.g. 22 or I can manually renumber everything in 10s again.
What I would like to do is press a button so that all the list number items ([ListNo]) are renumbered starting from 10 and increasing in increments of 10.
I'm looping as per code below but it's definately not happy. I have had a 'Google' but I'm struggling. Can any one help please?
Thanks
Private Sub btnRenumber_Click()
Dim rs As Recordset
Set rs = Me.RecordsetClone
Dim Val As Integer
Val = Me.ListNo
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Val = 10
Do Until rs.EOF = True
Val = Val + 10
rs.MoveNext
Loop
End If
End Sub
I have a 'to do' list (on a continuous form) where I want to change the order of things periodically. I am using an incremental numbering system using 10, e.g. item 1 = 10, item 2 = 20 and so on. If I need to squeeze something in I can use e.g. 22 or I can manually renumber everything in 10s again.
What I would like to do is press a button so that all the list number items ([ListNo]) are renumbered starting from 10 and increasing in increments of 10.
I'm looping as per code below but it's definately not happy. I have had a 'Google' but I'm struggling. Can any one help please?
Thanks
Private Sub btnRenumber_Click()
Dim rs As Recordset
Set rs = Me.RecordsetClone
Dim Val As Integer
Val = Me.ListNo
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Val = 10
Do Until rs.EOF = True
Val = Val + 10
rs.MoveNext
Loop
End If
End Sub