CapoStatus456
Programmer
So I have an access database with linked SharePoint tables. One of the columns in the table is multi-value. I'm using a recordset to create a new record and using another recordset to populate the multi-value field called "Team". However, when i run the code, I get a 3027 run-time error message ("Cannot update. Database or object is read-only"). Can someone help me out and let me know why I'm getting the error message? Here is the code:
Thanks in advanced for the help.
Code:
Set db = CurrentDb()
Set rs = db.OpenRecordset("MyTable")
Set rsBT = db.OpenRecordset("SELECT Person1ID, Person2ID, Person3ID, Person4ID FROM [PeopleData] WHERE Person1ID =" & Me.PersonFormField, dbOpenDynaset)
rs.AddNew
rs![Account] = Me.Account
rs!Person1ID = Me.PersonFormField
rs!Region = Me.Region
rs!Request = Me.Request
rs![Date In] = Now()
rs!Notes = Me.Notes
Set rsMV = rs.Fields("Team").Value
For i = 0 To 3
If Not IsNull(rsBT.Fields(i)) Then
rsMV.AddNew
rsMV.Fields(0) = rsBT.Fields(i)
rsMV.Update 'error happens on this line
Else
Exit For
End If
Next i
rs.Update
Thanks in advanced for the help.