The below code is doing exactly what is coded, however, I would like to only update the records that the query is pulling by dates. Is this possible to only update certain records in a table?
My Code:
Private Sub Report_Close()
On Error GoTo ErrorHandler
Dim sql As String
Dim rs As ADODB.Recordset
sql = "SELECT * FROM tblPending WHERE Sent is null"
Set rs = New ADODB.Recordset
rs.Open sql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With rs
If Not .BOF And Not .EOF Then
.MoveLast
.MoveFirst
If .Supports(adUpdate) Then
Do Until .EOF
![DuesStart] = Now() & ![DuesStart]
.Update
.MoveNext
Loop
End If
End If
.Close
End With
ExitSub:
Set rs = Nothing
Exit Sub
ErrorHandler:
Resume ExitSub
End Sub