Results 1 to 2 of 2

Thread: Error$

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    126

    Error$

    Hi i was wonderinging if there is a way to capture all errors in a module or something.

    i want to have a general error for example.

    on error goto GenError
    code

    exit sub

    GenError:
    msgbox err.source & " " & err.description

    then on every sub proceedure in my application all i have to do is call upon this.

    Any Help You can give me would be great.
    beginner

  2. #2
    Member
    Join Date
    Feb 2003
    Posts
    40
    Hello,
    Maybe this is a sollution to your problem?

    Private Sub Command1_Click()
    On Error GoTo fout

    Open "a:\testfile.xyz" For Input As #1


    Close 1

    Exit Sub
    fout:
    'Here you call the function.
    ShowErrMessage Err
    End Sub



    'This sub you can put in a module
    Public Sub ShowErrMessage(myError As ErrObject)
    MsgBox Err.Number & " " & Err.Description, vbOKOnly + vbCritical, "Error:"
    End Sub

    greets,
    J@b@r

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width