Results 1 to 5 of 5

Thread: Errors

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Ontario, Canada
    Posts
    134

    Errors

    I know about On Error Resume Next and On Error Goto ... But I was wondering if could do something like On Error Exit Sub or On Error Then ....

    Can what I'm asking be done?

  2. #2
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668

    Re: Errors

    Originally posted by Xerpher
    I know about On Error Resume Next and On Error Goto ... But I was wondering if could do something like On Error Exit Sub or On Error Then ....

    Can what I'm asking be done?
    What would be the use of that?

    VB Code:
    1. Private Sub Form_Click()
    2.         On error goto line1:
    3.         'CODE
    4.         'CODE
    5. line1:
    6. End sub

    And

    VB Code:
    1. Private Sub Form_Click()
    2.         On error goto line1:
    3.         'CODE
    4.         'CODE
    5. Exit sub
    6. line1:
    7.         'CODE
    8.         'CODE
    9. End sub
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

  3. #3
    Member
    Join Date
    Aug 2000
    Posts
    52
    What exactly do you want it to do when it faults?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Ontario, Canada
    Posts
    134
    I was kinda thinking of having something like

    On Error Then MsgBox "Error"

    You know what I mean? but I guess I'll just have to use the goto... I was just curious, Thanks you guys.

  5. #5
    Fanatic Member Alien_poo's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    668

    Re: Re: Errors

    VB Code:
    1. Private Sub Form_Click()
    2.         On error goto line1:
    3.         'CODE
    4.         'CODE
    5. Exit sub
    6. line1:
    7.         'CODE
    8.         Msgbox "Error"
    9. End sub
    "A RESPECTED scientist has put forward the stunning - if unsavoury - possibility that humans are descended from sewage dumped overboard by aliens."
    "First we read that we are the creation of God, then scientists say we are descended from apes. Now they say we're some sort of alien poo. How much further can we sink?"
    - Robert Matthews, Science Correspondent

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