Below is the code I am using to perform the action. This does not use a stored procedure. Who received the error and when appears to be random. The button can be used for several days by several approvers with out any error and the one day one user will have the problem. Also, I checked to see if particular records were affected as they relate to an employee record and I could not see and correlation. An employees records could be approved for several days and then suddenly they could not approve them. But the approver can go back and marks the check box one at the time. Also, I have notices that the problem does not occur when there are 10 or less records that need to be approved. But, it may approve 20 records one day and not approve 14 the next. That is why I think it is a timeout error.
Private Sub cmdAprv_Click()
Dim strSQL As String
Dim lngRvalue As Long
Dim lngCommit As Long
Dim conn As ADODB.Connection
On Error GoTo Err_Handler
DoCmd.SetWarnings False
strSQL = "UPDATE DailyLogs SET DailyLogs.DailyLogIsApproved = Yes WHERE DailyLogs.EmployeeID =" & cbWorkerName.Value & " AND DailyLogs.DailyLogDate = #" & tbDailyLogDate.Value & "#;"
Set conn = CurrentProject.Connection
conn.BeginTrans
conn.Execute strSQL, lngRvalue, adCmdText
If (lngRvalue > 0) Then
lngCommit = MsgBox("You are about to update " & lngRvalue & " records. Would you like to continue?", vbQuestion + vbOKCancel, "Confirm Update")
If (lngCommit = vbOK) Then
conn.CommitTrans
Else
conn.RollbackTrans
End If
End If
DoCmd.SetWarnings True
Me.Refresh
Set conn = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Description
End Sub