RiceRocket
Mar 28th, 2006, 01:30 PM
Hi, I have a form with some controls that perform actions on the current record such as "Create New", "Delete", "Move", etc. I also have a subform in this form that contains all the records I am working with (in continuous form view). Because the user can click on the record they want to work with and perform actions on, I want to be able to link the recordset of the subform and form. This will enable the user to click on the record in the subform then click an action button in the form and the action button will perform the action on the selected record in the subform.
I had this working by using this code in the Form_Open event:
Private Sub Form_Open(Cancel As Integer)
Set [Form].Recordset = [Subform].Recordset
End Sub
However, this would give me the 3020 run time error when changing the value of a control in the subform. The error is "Error 3020 - Update or CancelUpdate without AddNew or Edit." Why am I getting this error only when they are linked. Is there some way to link the form and subform without getting this error?
I had this working by using this code in the Form_Open event:
Private Sub Form_Open(Cancel As Integer)
Set [Form].Recordset = [Subform].Recordset
End Sub
However, this would give me the 3020 run time error when changing the value of a control in the subform. The error is "Error 3020 - Update or CancelUpdate without AddNew or Edit." Why am I getting this error only when they are linked. Is there some way to link the form and subform without getting this error?