There are a couple of tutorials in the Tutor's Corner about debugging programs and error handling, you might want to check them out.
Before you add any error handling code, the first thing to do is to try to prevent an error. If you declare an integer rather than a string and get an error, it makes no sence to add error code; just change dimention.
The most basic of all error handling code is the On Error statement. Generally, you'll put it at the beginning of the sub or function.
Just as a further tip, you should make sure that your code works
perfectly without any error handling. I put error handles in my
code, BUT, I comment them out during testing.
No, you cant make a standard module to drop into any project and then take over all the error handling. Dont know where you thought you saw that.
If you insist on this then the closest you can get is to rely on the fact that VB passes all errors up the calling chain. However, this is useless for event-based programs.
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe