Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

Viewing the Errors Stored in the Errors Collection

Sub TestErrorsCollection()     On Error GoTo TestErrorsCollection_Err     Dim db As DAO.Database     Set db = CurrentDb     db.Execute ("qryNonExistent")     Exit Sub TestErrorsCollection_Err:     Dim ErrorDescrip As DAO.Error     For Each ErrorDescrip In Errors         Debug.Print ErrorDescrip.number         Debug.Print ErrorDescrip.Description     Next ErrorDescrip     Exit Sub End Sub