I have a script which, when a button is clicked, moves the user to the next record but goes back through the record just input, loops through the names and adds them to the new record. So basically all the names entered on the previous record (via a continuous form) are retained for the new record.
The problem is, this works (almost) perfectly using the following code...
...but it orders the names in reverse because obviously it's moving to the last name then cycling back through them using 'MovePrevious' (I can't find a method of reordering the names). The obvious solution is to change the code to this...
...but for some reason this results in an infinite loop.
Does anyone know why this is happening and maybe think of another solution whereby the names entered in a continuous form can be retained so they are available when the user moves to the next record?
I hope I explained that ok...thanks for any help.
The problem is, this works (almost) perfectly using the following code...
Code:
If rs.RecordCount <> 0 Then
rs.MoveLast
Do While Not rs.BOF
rs.AddNew
rs("Name") = strName
rs.Update
rs.MovePrevious
Loop
End If
...but it orders the names in reverse because obviously it's moving to the last name then cycling back through them using 'MovePrevious' (I can't find a method of reordering the names). The obvious solution is to change the code to this...
Code:
If rs.RecordCount <> 0 Then
rs.MoveFirst
Do While Not rs.EOF
rs.AddNew
rs("Name") = strName
rs.Update
rs.MoveNext
Loop
End If
...but for some reason this results in an infinite loop.
Does anyone know why this is happening and maybe think of another solution whereby the names entered in a continuous form can be retained so they are available when the user moves to the next record?
I hope I explained that ok...thanks for any help.