Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Aug 22, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Effective Error Handling

While working with classes in VB 4.0, we found that the errors raised from our classes were not being trapped at the form level. We used "On Error Resume Next," but still the error was being raised in the class module. We changed the settings of the Advanced Tab from Options in the Tools menu to "Break Unhandled Error," and it worked as we needed. So, if you want to raise an error from a class module in your application to the form, you must use the Err.Raise method to raise the error. The error will be handled in the form only if you set the option from Options in the Tools menu in the Advanced Tab to "Break On Unhandled Error." Otherwise, the error is raised in the class itself because the default setting is "Break On Class Module."
System Builders
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date