I have a main form with a Add command to add a new record and an edit command.
The form has a subform which consequently has a further subform itself with a One to Many relation, all forms and subform are set no additions and no edits in the properties.
So I wrote the code to allow additions and edits:
And for the Edit command:
When I try to Add a record I get the below error:
The error is on 'Forms!frmDuties!sfrmRuns!sfrmNotes.Form.AllowAdditions = True'
The error is similar for also the Edit command.
Thanks
The form has a subform which consequently has a further subform itself with a One to Many relation, all forms and subform are set no additions and no edits in the properties.
So I wrote the code to allow additions and edits:
Code:
Private Sub CmdAdd_Click()
DoCmd.OpenForm "frmDuties", acNormal, "", "", acAdd
Forms!frmDuties!CmdEdit.Visible = False
Forms!frmDuties!DutyDate.SetFocus
Forms!frmDuties!sfrmRuns.Form.AllowAdditions = True
Forms!frmDuties!sfrmRuns!sfrmNotes.Form.AllowAdditions = True
End Sub
And for the Edit command:
Code:
Private Sub CmdEdit_Click()
Me.Form.AllowEdits = True
Me.DutyDate.SetFocus
Me.CmdEdit.Visible = False
Me.sfrmRuns.Form.AllowEdits = True
Me.sfrmRuns!sfrmNotes.Form.AllowEdits = True
End Sub
When I try to Add a record I get the below error:
The error is on 'Forms!frmDuties!sfrmRuns!sfrmNotes.Form.AllowAdditions = True'
The error is similar for also the Edit command.
Thanks