D
dave h
Hi,
In the code below, I created a small simulation of what is happening in a
larger context. Of course this is bad code, but I wanted to force an error
to get at the error handling problem. If I run this code without my error
handler (comment out the On Error Goto...) then Access returns a message box
for a runtime error of 91 and its description. With my error handling
enabled, my message box returns an error of 0 and no description. This is
the same behavior I get in my actual project. What am I doing wrong?
Thanks, Dave H.
Private Sub btnTest1_Click()
On Error GoTo Error_Handler
Dim rst As Recordset 'force an error
Forms("frmTest1").Controls("txtTest1") = rst.Fields("xx")
Exit_Procedure:
Exit Sub
Error_Handler:
On Error Resume Next
MsgBox "error Number " & Err.Number & ", " & Err.Description,
Buttons:=vbCritical
Resume Exit_Procedure
End Sub
In the code below, I created a small simulation of what is happening in a
larger context. Of course this is bad code, but I wanted to force an error
to get at the error handling problem. If I run this code without my error
handler (comment out the On Error Goto...) then Access returns a message box
for a runtime error of 91 and its description. With my error handling
enabled, my message box returns an error of 0 and no description. This is
the same behavior I get in my actual project. What am I doing wrong?
Thanks, Dave H.
Private Sub btnTest1_Click()
On Error GoTo Error_Handler
Dim rst As Recordset 'force an error
Forms("frmTest1").Controls("txtTest1") = rst.Fields("xx")
Exit_Procedure:
Exit Sub
Error_Handler:
On Error Resume Next
MsgBox "error Number " & Err.Number & ", " & Err.Description,
Buttons:=vbCritical
Resume Exit_Procedure
End Sub