The following code shows how one can record errors to a Errors log file. Create an Errors.log file first and place that file in your apps path. Place the error handling in whatever procedures you want. Place the errLogger procedure in a module as a public procedure or in a form as a private procedure.
Module
Public Sub errLogger(ByVal lNum As Long, ByVal sDesc As String, ByVal sFrom As String)
Dim FileNum As Integer
FileNum = FreeFile
Open App.Path & "\Errors.log" For Append As FileNum
Write #FileNum, lNum, sDesc, sFrom, Now()
Close FileNum
End Sub
Usage
Private Sub butGenErr_Click()
On Error GoTo Err_handler
Exit Sub
Err_handler:
If Err.Number <> 0 Then
errLogger Err.Number, Err.Description, "butGenErr_Click"
Err.Clear
Resume Next
End If
End Sub