Results 1 to 2 of 2

Thread: errors?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    102

    errors?

    hi again all,

    is there a way of making some sort of global error system, so if there is an error within the whole program it can go to one main errorHandler instead of what i do wich is make lots of little errorHandlers for every component?

    thanks
    aiden,
    [email protected]
    __________________
    The human race is a smart one, but we still don’t yet understand that if there is no food in the fridge the first time, there wont be food in the fridge the 2nd 3rd or hundredth time you check -- (…always hoping)

  2. #2
    Fanatic Member sridharavijay's Avatar
    Join Date
    Sep 2002
    Location
    http://www.vijaysridhara.in
    Posts
    589
    In a module write this code
    VB Code:
    1. Public sub ErrorDisplay(showError as boolean)
    2. If showError Then
    3.          Msgbox "Error :" & Err.Number & "  " &  Err.Description,vbOKOnly
    4. End if
    5.  
    6. ' Now in any function, you write lines like this
    7.  
    8. Private Sub Command1_Click()
    9. On Error Goto ED
    10. '<your code goes here...
    11.  
    12.  
    13. Exit Sub
    14. ED:
    15. ErrorDisplay True

    HTH

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