We help IT Professionals succeed at work.

Error Handeling - Forcing an error Problem

LJG
LJG asked
on
I'm trying to force and error and after handling the error I get error number 20 "Resume without error".  The error handling works great (been using the same for many years) except when I force and error.  Any ideas?

I get the error at     ---> Resume ProcedureDone

    If intProc_ReturnValue <> 20 Then
        Err.Number = -1
        Err.Description = "Problems with Stored Procedure -->  " & strProc_Name
        GoTo HandleError
    End If

   
'----

ProcedureDone:
    Set cmd1 = Nothing
    Exit Sub

HandleError:
    Select Case Err.Number
        Case Else
            ErrorHandler Err.Number, Err.Description, "Form_frm_Jobs_InputJob.Button_RefigureLineItems_Click", Me.Name, True        'ErrorHandler:$$N=Form_frm_Jobs_InputJob.Button_RefigureLineItems_Click
    End Select
    Resume ProcedureDone  '<--------- This is where I get the error

 
Comment
Watch Question

Commented:
to raise an error you want to use

err.raise -1,  "MyApp", "Problems with stored procedure --> " & strProc_Name

you don't need a goto it will immediately go to the default error handler
LJG

Author

Commented:
kmslogic:- Thanks so much - it solved my problem.

Just one note - I think you need an extra comma (2 commas after err.raise -1)

err.raise -1, , "MyApp", "Problems with stored procedure --> " & strProc_Name

Thanks Again
LJG