I have a command button that goes to a new record when clicked. However, I have some validation on a text box that ensures that the user enters a certain number. If this condition is not met, a message box is thrown up and the user can't advance until the condition is met. It is on this step that I get the error "can't go to specified record". I think it is the procedure behind the command button that is the culprit. Can I put something in the error handling code of the button that will control this?
Here is the code for the button:
Private Sub cmdTestNextReel_Click()
On Err GoTo Err_cmdTestNextReel_Click
DoCmd.GoToRecord , , acNewRec
Me.txtJDEdwardsNumber.SetFocus
Exit_cmdTestNextReel_Click:
Exit Sub
Err_cmdTestNextReel_Click:
MsgBox "Click OK to continue.", vbInformation, "Transfer Reels"
Resume Exit_cmdTestNextReel_Click
End Sub
txtJDEdwardsNumber is the control with the validation code.
Thanks so much.
Daniel Pope
Here is the code for the button:
Private Sub cmdTestNextReel_Click()
On Err GoTo Err_cmdTestNextReel_Click
DoCmd.GoToRecord , , acNewRec
Me.txtJDEdwardsNumber.SetFocus
Exit_cmdTestNextReel_Click:
Exit Sub
Err_cmdTestNextReel_Click:
MsgBox "Click OK to continue.", vbInformation, "Transfer Reels"
Resume Exit_cmdTestNextReel_Click
End Sub
txtJDEdwardsNumber is the control with the validation code.
Thanks so much.
Daniel Pope