J
Jake F
I tried to create an error log table to capture when errors occur with my
users and what they are. I'm having issues with the records locking by one
user and different ones cannot be updated for a bit. Not a major issue but a
hassle. The users update a yes/no option box on a subform. I put to run the
error log code in the after update, on error portion for the option box but
it's not running so is there somewhere else I need to put it so that when the
record lock error occurs it gets logged in? Here's the code for logging the
error, maybe I'm missing something in that.
Function ErrLog()
On Error GoTo Err_ErrLog
DoCmd.OpenForm "frmErrLog", acNormal, , , acFormAdd, acHidden
DoCmd.GoToRecord acDataForm, "frmErrLog", acNewRec
Forms!frmErrLog.ErrDt.Value = Now
Forms!frmErrLog.ErrUser.Value = fosUserName
Forms!frmErrLog.ErrNum.Value = Err.Number
Forms!frmErrLog.ErrDesc.Value = Err.Description
DoCmd.Close acForm, "frmErrLog", acSaveYes
MsgBox Err.Description & Chr(10) & Chr(13) & _
" The error has been logged, please try again later. Thank you.", _
vbOKOnly, "Error Report"
Exit_ErrLog:
Exit Function
Err_ErrLog:
MsgBox Err.Description & " : " & Err.Number
Resume Exit_ErrLog
End Function
users and what they are. I'm having issues with the records locking by one
user and different ones cannot be updated for a bit. Not a major issue but a
hassle. The users update a yes/no option box on a subform. I put to run the
error log code in the after update, on error portion for the option box but
it's not running so is there somewhere else I need to put it so that when the
record lock error occurs it gets logged in? Here's the code for logging the
error, maybe I'm missing something in that.
Function ErrLog()
On Error GoTo Err_ErrLog
DoCmd.OpenForm "frmErrLog", acNormal, , , acFormAdd, acHidden
DoCmd.GoToRecord acDataForm, "frmErrLog", acNewRec
Forms!frmErrLog.ErrDt.Value = Now
Forms!frmErrLog.ErrUser.Value = fosUserName
Forms!frmErrLog.ErrNum.Value = Err.Number
Forms!frmErrLog.ErrDesc.Value = Err.Description
DoCmd.Close acForm, "frmErrLog", acSaveYes
MsgBox Err.Description & Chr(10) & Chr(13) & _
" The error has been logged, please try again later. Thank you.", _
vbOKOnly, "Error Report"
Exit_ErrLog:
Exit Function
Err_ErrLog:
MsgBox Err.Description & " : " & Err.Number
Resume Exit_ErrLog
End Function