I have a form with a subform. The subform is linked okay, when I select a record on the mainform I can see the subform respond (ID1)
I am trying to add a record in the subform, but it errors with Object required 424. It highlights the line
rsDocksLink.Fields("ID1") = TY?
I tried making it equal to the field ID1 value on the mainform, but it told me I could not do that as the mainforms table needed a related record. Any ideas, thanks
Subform Code
Dim rsDocsLink As Recordset
Dim db As DAO.Database
Set rsDocsLink = CurrentDb.OpenRecordset("DocsLink", dbOpenDynaset)
rsDocsLink.AddNew
TY = Forms!TapeLogs!DocumentsForm.Form.ID1
rsDocksLink.Fields("ID1") = TY
rsDocsLink.Fields("DocName") = DocNames
rsDocsLink.Update
I am trying to add a record in the subform, but it errors with Object required 424. It highlights the line
rsDocksLink.Fields("ID1") = TY?
I tried making it equal to the field ID1 value on the mainform, but it told me I could not do that as the mainforms table needed a related record. Any ideas, thanks
Subform Code
Dim rsDocsLink As Recordset
Dim db As DAO.Database
Set rsDocsLink = CurrentDb.OpenRecordset("DocsLink", dbOpenDynaset)
rsDocsLink.AddNew
TY = Forms!TapeLogs!DocumentsForm.Form.ID1
rsDocksLink.Fields("ID1") = TY
rsDocsLink.Fields("DocName") = DocNames
rsDocsLink.Update