Setting AllowAdditons & AllowDeletions for a form is quite easy, use
Code:
Me.AllowAdditions = True
Me.AllowAdditions = False
Me.AllowDeletions = True
Me.AllowDeletions = False
of
Code:
Forms!YourFormName.AllowAdditions = True
Forms!YourFormName.AllowAdditions = False
Forms!YourFormName.AllowDeletions = True
Forms!YourFormName.AllowDeletions = False
as the case may acquire for a form.
Similarily, for a subform
Code:
Forms!FormName!SubformName.form.AllowAdditions = true
etc.
If your really don't know the subforms associated with a form, you cycle through the main forms controls checking each control's data type and for each subform data type encountered, set that subforms AllowAdditons, AllowDeletes property as appropriate. Lookup and search this form for searching a form controls. I'm not big on giving people code.
If you need to do all this is a subroutine, which is not necessary, you subroutine reference is
Code:
Sub SetFormsProperty(FormName as Form, FormProperty as String, Status as Boolean)
forms(formName).(FormProperty)=Status
'cycle through form's control container as indicated above
end sub
Why not just use
Me.AllowAdditions = true
forms!YourformName!YourSubformName.form.AllowAddit ions=True