I am performing a series of updates from a command button on an access form. I want to record the number of records affected for each update transaction.
I have simplified some code..
As you can see i am able to show the number of affected records in a message box, but as soon as i set that value to equal a variable i receive the error message 'can't assign to read only property'.
As my actual code is performing a number of updates i want to be able to store the number of affected records for each update. Those numbers will later be written to another table..
Does anyone have any ideas??? I'm stuck.
I have simplified some code..
Private Sub cmdTest_Click()
Dim db As Database
Dim Test1, Count1 As String
Set db = CurrentDb()
Test1 = "UPDATE TestTable SET TestTable.TestF ield = '1'" & _
"WHERE (((TestTable.Us er)='Alex Lewendon'));"
db.Execute Test1
'db.RecordsAffe cted = Count1
MsgBox "Update Complete. " & CStr(db.Records Affected) & " records were updated successfully"
End Sub
Dim db As Database
Dim Test1, Count1 As String
Set db = CurrentDb()
Test1 = "UPDATE TestTable SET TestTable.TestF ield = '1'" & _
"WHERE (((TestTable.Us er)='Alex Lewendon'));"
db.Execute Test1
'db.RecordsAffe cted = Count1
MsgBox "Update Complete. " & CStr(db.Records Affected) & " records were updated successfully"
End Sub
As you can see i am able to show the number of affected records in a message box, but as soon as i set that value to equal a variable i receive the error message 'can't assign to read only property'.
As my actual code is performing a number of updates i want to be able to store the number of affected records for each update. Those numbers will later be written to another table..
Does anyone have any ideas??? I'm stuck.
Comment