Results 1 to 6 of 6

Thread: Help - Level Easy

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Every time there is an error, I like my program run another procedure and when it finish, go to the next line in the original procedure.

    Do I use "On error Goto"? Please give me an example because I am stuck.
    Mako Shark
    Great White

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Yes here's the basic idea about error handling:

    On error goto errorhandler:

    a statement or method causing error


    exit [methodtype] 'avoids errorhandler to execute after method contents

    errorhandler:

    handling the error

    resume next 'Resumes to next line
    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
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb

    All you need is the Resume Next in you Error Handle routine to continue the next command line.

    Code:
    Private Sub Form_load()
    On Error Goto MyErrorHandle
      >>Your code here
    
    Exit Sub
    MyErrorHandle:
       >>Do What ever you want here.
       Resume Next
    End Sub

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Talking

    Thanks in a million to both of you guys.

    Thanks for the detail code Chris!

    Bye

    Mako Shark
    Great White

  5. #5
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Hello Shark!

    You should take a look at these too.


    • Resume
    • Resume [0]
    • Resume Next
    • Resume line

    Chemically Formulated As:
    Dr. Nitro

  6. #6
    Guest

    Unhappy Hmmm...sounds like you are expecting an error

    Ok if you are expecting an error...you probably know the line of code that is going to generate it...(does happen and can be valid e.g testing for an Excel instance). Trap the error with something like

    If Err = 427 Then Err = 0

    Allows the program to continue execution without any GoTos.

    Probably not what you are after but what the heck its FYI

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