M
Mark A. Sam
Hello,
I am trying to debug a problem in my code. Here is the error code:
error_Section:
If Err = 3021 Then 'No Current Record in Subform Users
Resume Next
ElseIf Err = 3146 Then
Stop
Resume Next
ElseIf Err = 91 Then
Stop
Resume Next
Else
MsgBox "Error " & Err & ": " & Err.Description & " (Order Form's Current
Event)"
Resume Next
Stop
End If
This is occuring when I delete a record, the forms current event fires. I
know the lines of code that are causing the problem, but here this is
puzzling me.
When err is 3146, the code breaks where it is suppose to, but the value of
err is 94 instead of 3146.
Previously I had the lines,
ElseIf Err = 3146 or Err = 91 Then
Stop
Resume Next
Err 3146 should occur first, but when execution stopped, the value was 91.
Originally I didn't trap for 3146 and 91 and it looked like this:
error_Section:
If Err = 3021 Then 'No Current Record in Subform Users
Resume Next
Else
MsgBox "Error " & Err & ": " & Err.Description & " (Order Form's Current
Event)"
Resume Next
Stop
Then I would get the Message Box reporting first an err of 3146, then 91,
but the Stop statement was ignored and execution continued. That is why I
added the additional trapping.
Is there a reason for this?
Thanks
Mark A. Sam
I am trying to debug a problem in my code. Here is the error code:
error_Section:
If Err = 3021 Then 'No Current Record in Subform Users
Resume Next
ElseIf Err = 3146 Then
Stop
Resume Next
ElseIf Err = 91 Then
Stop
Resume Next
Else
MsgBox "Error " & Err & ": " & Err.Description & " (Order Form's Current
Event)"
Resume Next
Stop
End If
This is occuring when I delete a record, the forms current event fires. I
know the lines of code that are causing the problem, but here this is
puzzling me.
When err is 3146, the code breaks where it is suppose to, but the value of
err is 94 instead of 3146.
Previously I had the lines,
ElseIf Err = 3146 or Err = 91 Then
Stop
Resume Next
Err 3146 should occur first, but when execution stopped, the value was 91.
Originally I didn't trap for 3146 and 91 and it looked like this:
error_Section:
If Err = 3021 Then 'No Current Record in Subform Users
Resume Next
Else
MsgBox "Error " & Err & ": " & Err.Description & " (Order Form's Current
Event)"
Resume Next
Stop
Then I would get the Message Box reporting first an err of 3146, then 91,
but the Stop statement was ignored and execution continued. That is why I
added the additional trapping.
Is there a reason for this?
Thanks
Mark A. Sam