Public Function ErrorLog(objName As String, routineName As String) Dim db As Database Set db = CurrentDb Open "C:\Error.log" For Append As #1 Print #1, Format(Now, "mm/dd/yyyy, hh:nn:ss") & ", " & db.Name & _ "An error occured in " & objName & ", " & routineName & _ ", " & CurrentUser() & ", Error#: " & Err.Number & ", " & Err.Description Close #1 End Function ------------------------------------------- Use it like this: Sub MyExample() On Error GoTo Err_Handler ' Your code here Exit_Here: Exit Sub Err_Handler: Call ErrorLog("frmMyForm", "MyExample") Resume Exit_Here End Sub