HomeGrowth
Technical User
I have an On Error handling on Form_Load, basically, if the user has the write access, goto New record. Usually, if the user doesn't have the write access, it generate error code 2105. So I have the error handling by goto First record. But My problem is the Error Handler didn't trigger, instead, I got the error message "Run time error '2105'. You can't goto the specific record". So, why the error handler can't work? Thanks!
Private Sub Form_Load()
On Error GoTo Err_Form_Load_Click
DoCmd.GoToRecord , , acNewRec
Exit_Form_Load_Click:
Exit Sub
Err_Form_Load_Click:
If Err.Number = 2105 Then
DoCmd.GoToRecord , , acFirst
Resume Next
Else
MsgBox Err.Description
Resume Exit_Form_Load_Click
End If
End Sub
Private Sub Form_Load()
On Error GoTo Err_Form_Load_Click
DoCmd.GoToRecord , , acNewRec
Exit_Form_Load_Click:
Exit Sub
Err_Form_Load_Click:
If Err.Number = 2105 Then
DoCmd.GoToRecord , , acFirst
Resume Next
Else
MsgBox Err.Description
Resume Exit_Form_Load_Click
End If
End Sub