i have a module, and im still new to VB so i do not know how to call on it when a error happens. also i would like it to also report what form they where on when the error occur d how can i record this?
Code:
Dim db As DAO.Databaset
Dim rserror As DAO.Recordset
Set db = CurrentDb
Set rserror = db.OpenRecordset("Errors", dbOpenDynaset)
MsgBox "The program has encounterd a error! The error has been recorded and sent to the database admin, ''Error: " & Err.Description & " Error Number: " & Err.Number & "''. " & "If you have received the error Invalid use of Null, please make sure that all the required fields are not empty.", vbCritical + vbOKOnly, "Error!"
With rserror
.AddNew
.Fields("Error Reason") = Err.Description
.Fields("User") = Forms![InfoKeeper]![Loginname]
.Fields("Error Number") = Err.Number
.Update
End With
rserror.Close
Set rserror = Nothing