I am writing some code in which I am emptying a particular field in every record in a given table. My code works fine, but I don't like the fact that I have to rely on an error to break out of my while loop. Is there another way to determine when I am at the end of the table?
On Error GoTo Err_Form_Open
'set toShip column to zero for all records
DoCmd.GoToRecord acDataForm, "ShipComponentsForm", acFirst
While (True)
Forms!ShipComponentsForm.ToShip = Empty
DoCmd.GoToRecord acDataForm, "ShipComponentsForm", acNext
Wend
Err_Form_Open
Exit Sub
On Error GoTo Err_Form_Open
'set toShip column to zero for all records
DoCmd.GoToRecord acDataForm, "ShipComponentsForm", acFirst
While (True)
Forms!ShipComponentsForm.ToShip = Empty
DoCmd.GoToRecord acDataForm, "ShipComponentsForm", acNext
Wend
Err_Form_Open
Exit Sub