You could always raise custom errors, though. At the very least, return a status from your methods that you could use.VB Code:
Public Function MyMethod( _ ByVal MyParam As Integer, _ Optional ByRef ErrRetVal As Long, _ Optional ByRef ErrRetSrc As String, _ Optional ByRef ErrRetDesc As String) On Error Goto err_MyMethod 'If It's Something You don't like... If MyParam = 17 Then 'Raise an Error (arbitrary number) Err.Raise vbObjectError + 8080, , "I don't like this number" End If exit_MyMethod: 'Do cleanup if necessary Exit Function err_MyMethod: ErrRetVal = Err.Number ErrRetSrc = Err.Source ErrRetDesc = Err.Description Resume exit_MyMethod End Function




Reply With Quote