Hi, hope all is well. I'm trying to add a button to an access form that will add a more frequently used attachment to a table. I'm getting the following error . Run time error 3852 cannot update a multivalued field if its parent recordset is not in edit mode. To place the parent recordset in edit mode use the AddNew or Edit mode.
Im not sure why the field is multivalued as it is just an attachment field and im trying to go into edit mode and addnew. The code is below , can someone have a look please and see if they can find what im doing wrong..thanks
Im not sure why the field is multivalued as it is just an attachment field and im trying to go into edit mode and addnew. The code is below , can someone have a look please and see if they can find what im doing wrong..thanks
Code:
Dim rsfile As Recordset
Set rsfile = CurrentDb.OpenRecordset("tblRPS")
'Instantiate the child recordset.
Set rsReport = rsfile.Fields("File1").Value
'Add a new attachment here.
filePath = "C:\timerrf\rf.txt"
rsReport.Edit
rsReport.AddNew
rsReport.Fields("FileData").LoadFromFile (filePath)
rsReport.Update
'Update parent record
rsfile.Update