D
Dino
I need to insert a very simple error handling procedure in my code to open a
form. I'm not getting where to place it in the original code sequence. Both
are very simple but they aren't working together so far. I have a form with a
text box for entering account number, and an OK button which opens a form
that's based on a query. It works fine until I try to put the error handling
in there. It either ignores it completely or gives me an error message
depending on where I put the error code.
Original:
Private Sub cmdOK_Click()
DoCmd.OpenForm "Account Detail Form", acViewNormal, acEdit
End Sub
Error handling code:
Public Function Verify_Input() As Boolean
On Error GoTo ErrorHandler
Exit Function
ErrorHandler:
MsgBox ("Account not found.")
Resume
End Function
Where does this error code go in relation to the original open form code?
Dino
form. I'm not getting where to place it in the original code sequence. Both
are very simple but they aren't working together so far. I have a form with a
text box for entering account number, and an OK button which opens a form
that's based on a query. It works fine until I try to put the error handling
in there. It either ignores it completely or gives me an error message
depending on where I put the error code.
Original:
Private Sub cmdOK_Click()
DoCmd.OpenForm "Account Detail Form", acViewNormal, acEdit
End Sub
Error handling code:
Public Function Verify_Input() As Boolean
On Error GoTo ErrorHandler
Exit Function
ErrorHandler:
MsgBox ("Account not found.")
Resume
End Function
Where does this error code go in relation to the original open form code?
Dino