0 Replies - 855 Views - Last Post: 20 August 2008 - 12:00 PM Rate Topic: -----

#1 Tekito   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-August 08

Error handling for user-created events

Post icon  Posted 20 August 2008 - 12:00 PM

I have created some class modules with events and am trying to implement error handling. One thing that so far seems impossible is the ability to pass errors in event routines up the procedure stack. This is because (I think) that Visual Basic considers normal events (like clicking a form) to always be at the very top of the stack, so it does not implement passing errors up to a higher procedure. This does not make sense to me at all. For user-created events, we could be using them for all sorts of things, and they can be inside any subroutine, so I do not see why we can't pass errors for these events up the stack like normal. Is there a workaround for this, or am I missing something? Right now it is quite a pain...

(So far my best option is to go back and add a ByRef variable for the err number for every event I created, then in case of error trap it and pass this error number back to the calling procedure. But it is getting messy and hopefully it can be avoided.)

Is This A Good Question/Topic? 0
  • +

Page 1 of 1