I need to sequentially process a recordset from bottom to top and then once all records completed I need to go back to the first record and set a flag within the record.
It works fine until the last bit. On investigating I have found that assuming 4 records it runs through the records four times fine but then tries to run through a 5th time and so falls over.
I start the loop with
and then all sorts of bits in the middle and I end it with
Anyone got any ideas what i have got wrong here? It is rather doing my head in!
Thanks
It works fine until the last bit. On investigating I have found that assuming 4 records it runs through the records four times fine but then tries to run through a 5th time and so falls over.
I start the loop with
Code:
' Set flag on last dosette dispensing date
rstDld.MoveLast
' Sequentially process dosette labels from last to first
Do While Not rstDld.BOF And Not rstDld.EOF
' Set flag for new record
rstDld.Edit
rstDld!bDosLab = -1
rstDld.Update
Code:
' Move to previous record unless already on first record
rstDld.MovePrevious
Loop
'Reset the first date back to yes
rstDld.MoveFirst
rstDld.Edit
rstDld!bDosLab = -1
rstDld.Update
' Close the recordset
rstDld.Close
Anyone got any ideas what i have got wrong here? It is rather doing my head in!
Thanks