I am using buttons to add data. I used this code. It works perfectly on the main form.
I need to add another button on the main form that adds data to the subform. I know Me. is used on main form. I cannot get the syntax right for the subform.
Main form is frmTicket
subform is frmTicketDetailsSubform
Field I want to update is
FoodID so if it was on the main form it would be Me.FoodID = 1
I tried this before I knew Me. did not work on subform
Thank You for the help
Code:
If Me.NewRecord = False Then
DoCmd.GoToRecord acDataForm, "frmTicket", acNewRec
Me.CustomerID = 1
End If
I need to add another button on the main form that adds data to the subform. I know Me. is used on main form. I cannot get the syntax right for the subform.
Main form is frmTicket
subform is frmTicketDetailsSubform
Field I want to update is
FoodID so if it was on the main form it would be Me.FoodID = 1
I tried this before I knew Me. did not work on subform
Code:
If Me.NewRecord = False Then
DoCmd.GoToRecord acDataForm, "frmTicketDetailsSubform", acNewRec
Me.FoodID = 1
End If
Thank You for the help
Last edited by a moderator: