billmsacces
Programmer
I am trying to clear a continuous form using the following code.
Private Sub ClearForm_Click()
Do While Me.NewRecord = False
field1 = 0
field2 = 0
field3 = 0
DoCmd.GoToRecord acDataForm, "form1", acNext
Loop
End Sub
It works fine until it reaches the DoCmd.GoToRecord line.
I get the follwing error.
Run-time Error '2105':
You can't go to the specified record.
How can this be resolved?
Private Sub ClearForm_Click()
Do While Me.NewRecord = False
field1 = 0
field2 = 0
field3 = 0
DoCmd.GoToRecord acDataForm, "form1", acNext
Loop
End Sub
It works fine until it reaches the DoCmd.GoToRecord line.
I get the follwing error.
Run-time Error '2105':
You can't go to the specified record.
How can this be resolved?