Object Reference > True DBGrid Events > Error Event |
Error Event
The Error event occurs only as the result of a data access error that takes place when no Visual Basic code is being executed.
object_Error (DataError As Integer, Response As Integer)
Arguments
DataError is an integer that identifies the error that occurred.
Response is an integer that may be set to 0 to suppress error message display.
Even if your application handles run time errors in code, errors can still occur when none of your code is executing, as when the user clicks a Data control button or changes the current record by interacting with a bound control. If a data access error results from such an action, the Error event is fired.
If you set the Response argument to 0, no error message will be displayed.
If the Response argument retains its default value of 1, or if you do not code an event procedure for the Error event, the message associated with the error will be displayed.
Note
Use the ErrorText property to retrieve the error string that will be displayed.