Results 1 to 6 of 6

Thread: Error Handling

  1. #1
    Guest

    Unhappy

    How do I handle an error that gives a "type mismatch" when
    the text boxes are empty?

    Thanks everybody

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Dish girlfriend...

    In what context are you getting the error. Provide some code.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Guest
    Put this line at the very top of all the code.

    On Error Resume Next

    This line ignores all errors and just stops the code.

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    By Matthew Gates:

    On Error Resume Next

    This line ignores all errors and just stops the code.
    I don't agree matthew, it does not stop the code, it just resumes to the next line, check out this small code.

    Code:
    Private Sub Form_Load()
    On Error Resume Next
    Err.Raise 23
    MsgBox "test"
    End Sub
    It'll just display the msgbox

    In case you want to actually Exit the Sub:

    Code:
    Private Sub Form_Load()
    On Error GoTo ErrH
    Err.Raise 23
    MsgBox "test"
        Exit Sub 'In case no errors occur
    
    ErrH:
        Exit Sub 'an error occured, exit the sub.
    End Sub
    I know you already knew all this Matthew, but just to tell the people who didn't
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  5. #5
    Guest
    Perhaps, a misunderstanding Jop?
    What I meant was that it stops the error a.k.a ignores it and continues on.
    Sorry I didn't explain myself .

    By the way, a little late, but...
    Happy Birthday~!

  6. #6
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    No problem Matt...
    and hey, better late then never
    thanks!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

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