Results 1 to 4 of 4

Thread: Error?

  1. #1

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    I am trying to call an error handler in module from a form. What is the correct syntax to call it?
    Normal is boring...

    smh

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'bas module code for errors
    Public Sub GetErrorSub()
      If Err.Number = 19 Then
        '
        Else
        MsgBox Err.Number
        End If
    End Sub
    '
    'form event code
    Private Sub Command1_Click()
        On Error GoTo errHandle:
         'bla bla bla
         'bla bla bla
         'bla bla bla
    'leave disk out to generate an error
         Dir ("a:\")
        Exit Sub
    errHandle:
           GetErrorSub
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    New Member
    Join Date
    Feb 2001
    Location
    Portugal
    Posts
    12
    first, you must check it the error handler function is not private.

    if it's public you can simply type the name of the function and give the paramters or you can specify the module name. eg

    errhandle param1, param2, param3

    or

    modulename.errhandle param1, param2, param3

    Apple

  4. #4

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    Thanks for the help!
    Normal is boring...

    smh

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