Hi there,
I'm having real problems updating a field through VBA. I get the error message 3027 saying that it is read only. There are no read only issues with the database etc, I think it is the query using joins that causes the problem.
Has anyone any suggestions about how to get around this?
Thank you...
I'm having real problems updating a field through VBA. I get the error message 3027 saying that it is read only. There are no read only issues with the database etc, I think it is the query using joins that causes the problem.
Has anyone any suggestions about how to get around this?
Thank you...
Code:
Set rs1 = db.OpenRecordset("QRY EDUCATION Incorrect nos")
rs1.MoveFirst
Do Until rs1.EOF
strOldPay = rs1.Fields("Old")
strNewPay = rs1.Fields("New")
'tab_CONTRIBUTION
Set rs2 = db.OpenRecordset("SELECT [tab_CONTRIBUTION].[ID-NUMBER] FROM [tab_CONTRIBUTION] LEFT JOIN [tab_EE-MAIN2] ON [tab_CONTRIBUTION].[ID-NUMBER] = [tab_EE-MAIN2].[EMPLOYEE-NO] WHERE [tab_EE-MAIN2].[EE-PAYROLL]='2'")
rs2.MoveFirst
Do Until rs2.EOF
If rs2.Fields("ID-NUMBER") = strOldPay Then
rs2.Edit
rs2.Fields("ID-NUMBER") = strNewPay
rs2.Update
End If
rs2.MoveNext
Loop
rs2.Close
Set rs2 = Nothing
etc etc...