Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 3027 Cannot Update...

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
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...

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...
 
Thanks for your help PHV but that didn't help. I've read through the link that you provded but I'm still a little lost with this. Any more ideas?
 
check properties of openrecordset (F1...).


Probably opening with "dbOpenDynamic" or another option will resolve this.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top