Record lock error sent to log

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top