Trapping Error

How to Trap Error in Visual Basic

Submitted by donbermoy on
Error trapping let you intercept and deal with run-time errors, rather than having programs abort or ignore a fatal error and can possibly causing loss of data. But there is one way to trap error in Visual Basic. It has the same syntax with VB 6.0 and VB.NET. To prevent the program from error we have to use the On Error Goto Statement. Now lets start this tutorial! :) 1.