Here's another bit of code showing the use of RecordsAffected using DAO. But it isn't clear exactly what you are having difficulty with (to me at least).
Code:
'---------------------------------------------------------------------------------------
' Procedure : UpdateBy
' Author : Jack
' Date : 25-10-2011
' Purpose : Update records in a table(Invoicetest) showing who (Environ("UserName")) imported the record.
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: N/A
' Dependency: N/A
'--------------------------------------------------------------------------
'
Public Sub UpdateBy()
Dim SQL As String
Dim db As DAO.Database
Dim WINUSERNAME As String
10 Set db = CurrentDb
20 On Error GoTo UpdateBy_Error
30 WINUSERNAME = Environ("UserName")
40 SQL = "UPDATE Invoicetest SET ImportedBy='" & WINUSERNAME & "';"
'Execute the Update sql and put up a msgbox showing How ManyRecords were Updated
50 db.Execute SQL, dbFailOnError
51 MsgBox "Records updated " & db.RecordsAffected, vbOKOnly
60 On Error GoTo 0
70 Exit Sub
UpdateBy_Error:
80 MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure UpdateBy of Module AWF_Related"
End Sub
Good luck with your project.