G
Guest
Hi,
I am trying to create a new record in a subform "subA" but I keep getting
the message "There is no field named 'SubA' in the current record". Before
new records are added, the AllowAdditions property of both the main form and
subform are set to false. So far, I haven't changed the AllowAdditions
property for the mainform to true (I've just changed the subform's). It is a
pop up form that creates the new record in the subform.
Here is my code:
(This is from the click event of a button on the pop up form)
(stForm is the mainform and stSubForm is the subform)
Forms(stForm).form(stSubForm).Form.AllowAdditions = True
DoCmd.GoToControl Forms(stForm).Form(stSubForm).Name
DoCmd.GoToRecord , , acNewRec
Forms(stForm).Form(stSubForm).Controls("Box") = 1
Forms(stForm).Form(stSubForm).Form.AllowAdditions = False
It doesn't seem lilke I can set the focus to the subform to create a new
record.
Thanks in advance.
I am trying to create a new record in a subform "subA" but I keep getting
the message "There is no field named 'SubA' in the current record". Before
new records are added, the AllowAdditions property of both the main form and
subform are set to false. So far, I haven't changed the AllowAdditions
property for the mainform to true (I've just changed the subform's). It is a
pop up form that creates the new record in the subform.
Here is my code:
(This is from the click event of a button on the pop up form)
(stForm is the mainform and stSubForm is the subform)
Forms(stForm).form(stSubForm).Form.AllowAdditions = True
DoCmd.GoToControl Forms(stForm).Form(stSubForm).Name
DoCmd.GoToRecord , , acNewRec
Forms(stForm).Form(stSubForm).Controls("Box") = 1
Forms(stForm).Form(stSubForm).Form.AllowAdditions = False
It doesn't seem lilke I can set the focus to the subform to create a new
record.
Thanks in advance.