Results 1 to 5 of 5

Thread: On Error wont work

  1. #1

    Thread Starter
    Addicted Member Smie's Avatar
    Join Date
    Jun 1999
    Location
    Columbus, OH
    Posts
    249
    no matter what i do in my project, On Error Goto ######, On Error Resume Next, it doesnt work. I don't Understand why it wont, some of my prjects do work while others, when given an On Error statement, still error..... Any clue?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You should post your code, errors could still appear if you don't have your errohandling set correctly
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    Make sure that you have your On Error Resume Next statement before the line where the Error occurs. The best place to put it would be at the top.

  4. #4
    Guest
    A little example on ignoring the error would be:

    Code:
    Private Sub Form_Load()
    On Error Resume Next
    For i = 0 to 100
    Error i
    Next i
    'Sorry, didn't know what error to choose :p.
    Exit Sub
    End Sub
    And if you were to capture it:

    Code:
    Private Sub Form_Load()
    On Error GoTo ErrorTrap
    For i = 0 To 100
    Error i
    Next i
    Exit Sub
    ErrorTrap:
    MsgBox "Error " & Err.Number & " - " & Error$
    End Sub
    Hope that helps.

  5. #5
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ....

    Maybe I am being too foolish, but Smie, just go to Project > Properties and on the General tab, see whether Break on All Errors is selected. If it is, change it to Break on Unhandled Errors.

    And if you have already done it and still are having problems, listen to the Gurus instead of me!

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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