I have a form "frmRecipes" that contains subform "frmIngredients". Both are set so as to not allow any additions or edits.
I am creating a button called "Add" on frmRecipes which will need to add records to the tables associated with both forms.
I understand that the following code will allow me to add a new record on the main form:
Code:
Private Sub btnAdd_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.txtRecipeName = " "
Me.AllowAdditions = false
End Sub
If I were to modify the code so as to do this, would that Me.AllowAdditions refer to frmRecipes or my frmIngredients?
Code:
Private Sub btnAdd_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.txtRecipeName = " "
Me.AllowAdditions = False
DoCmd.OpenForm "frmIngrendients"
Me.AllowAdditions = True ' <------- THIS ONE <-----------
End Sub