err.raise not trappable in class module 
Author Message
 err.raise not trappable in class module

I am trying to trap errors raised in a class module. Here is an example of
the problem. Create a new class module named 'clsTest' with this function:

Public Function RaiseError()
    Err.raise 1         ' How can the calling method trap this?
End Function

Call RaiseError from within an error trap as below:

Public Sub DoTest()
    Dim myTest As New clsTest

    On Error Resume Next        ' On Error Goto fails to trap it also
    Call myTest.RaiseError      
    Stop        ' never executes stop
End Sub

I need to trap the err.raise in the calling method. Can someone help?
Thanks in advance.

ce huff



Tue, 31 Aug 1999 03:00:00 GMT  
 err.raise not trappable in class module

I figured this out on my own. In Menu/Options/Advanced I had selected
"Break in Class Modules". I changed it to "Break on Unhandlable Errors" and
my error handler now works as expected. (BTW this is in Access97.)



Tue, 31 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Raising Err in Class Module

2. Problems with Err.Raise in a class module.

3. Err.Raise in OLE Server EXE not raising error in calling program

4. Err.Raise - error not being re-raised all the way to top of the call stack

5. Raising Events (not within a module or class)

6. Err.Raise Not Returning Proper Value

7. Err.Raise doen not work in the following scenario

8. Err.Raise doen not work in the following scenario

9. Err.Raise doen not work in the following scenario

10. Raising errors from (class module) objects

11. FYI, Trappable errs VB 4.0

12. Class modules 97 - Refering to array within a custom class module

 

 
Powered by phpBB® Forum Software