Results 1 to 3 of 3

Thread: Help - On Error Goto

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Edmonton,AB, Canada
    Posts
    30

    Question

    Hello my gracious colleagues,

    I have a small problem with the On Error Goto functionality
    in the application I inherited. Heres a snipit of the code:
    Private Sub cmdOneRight_Click()

    (A whole bunch of code)

    On Error GoTo lb_exist
    Set parNode = Tree2.Nodes.Item(parKey)
    GoTo lb1

    lb_exist:
    (Some other type of Code)

    lbl1:
    (Some more code)
    end sub

    Now the explanation:
    When the application gets to the "Set parNode = Tree2.Nodes.Item(parKey)" (parKey = R8) it fails with the following error message:

    Run-time error '35601': Element Not found"

    and will not goto lb_exist.

    Now the questions:
    1) Why will VB5 sp3 not got to lb_exist when the error is
    encoutered?
    2) How would I fix this problem?

    Thanks to all who help.

    David L. Baudais
    Systems Analyst


  2. #2
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    errors

    Unless you need to see the error you could try to incorperate a On error resume next, but I don't know if that is what will work well for you.
    Matt

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Edmonton,AB, Canada
    Posts
    30

    Talking Thanks

    Boy do I feel DUMB
    I found my STUPID pills again and I thought I threw them
    out.

    Firstly thanks Matt for your suggestion.
    The real problem is that the IDE was set to break on ALL
    errors. Once I change it to break on unhandled errors
    everything now works fine.

    TGIT (Thank God Its Thursday) and tomorrow is Friday.

    David L. Baudais
    Systems Analyst


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