J
John F
I am trying to do something that I am sure is very common, specifically
having buttons on the parent form to add and delete a single record on a
subform. I did a search and found suggestions along these lines (including
some variations I tried):
DoCmd.GoToRecord , "Forms!frmParent![fsubSubform].Form", acNewRec
DoCmd.GoToRecord , "Form!frmParent.fsubSubform", acNewRec
DoCmd.GoToRecord , "Me.fsubSubform", acNewRec
DoCmd.GoToRecord , "fsubSubform", acNewRec
The message I received was fsubSubform not open. So I tried
DoCmd.OpenForm "fsubSubform", , , , acFormAdd which was no good because
opened the subform in a separate window.
So I searched again and found someone who received the same message subform
not open. The advice given was to implement a Recordset instead.
Specific questions:
1. Were the suggestions inconsistent, and is implementing a Recordset the
only way to add and delete records on a subform?
2. The suggestion to use a Recordset specifically suggested a recordset
clone. Do I really need a clone? I don’t think I need separate record
pointers.
3. After updating recordset is a requery or something else needed so that
the subform will immediately reflect the added or deleted form?
4. Is there some source of a simple example to show adding and deleting a
single record via an ADO recordset?
Thanks,
John
having buttons on the parent form to add and delete a single record on a
subform. I did a search and found suggestions along these lines (including
some variations I tried):
DoCmd.GoToRecord , "Forms!frmParent![fsubSubform].Form", acNewRec
DoCmd.GoToRecord , "Form!frmParent.fsubSubform", acNewRec
DoCmd.GoToRecord , "Me.fsubSubform", acNewRec
DoCmd.GoToRecord , "fsubSubform", acNewRec
The message I received was fsubSubform not open. So I tried
DoCmd.OpenForm "fsubSubform", , , , acFormAdd which was no good because
opened the subform in a separate window.
So I searched again and found someone who received the same message subform
not open. The advice given was to implement a Recordset instead.
Specific questions:
1. Were the suggestions inconsistent, and is implementing a Recordset the
only way to add and delete records on a subform?
2. The suggestion to use a Recordset specifically suggested a recordset
clone. Do I really need a clone? I don’t think I need separate record
pointers.
3. After updating recordset is a requery or something else needed so that
the subform will immediately reflect the added or deleted form?
4. Is there some source of a simple example to show adding and deleting a
single record via an ADO recordset?
Thanks,
John