Set Add or view property of subform declared by SourceObject

A

Andi

I have a form with menu options that are set to populate a subform when a
option is double clicked. For example, if Head option is clicked the head
form becomes the subform. How can I set the Add data and View data properties
of these subforms so that when I want to add a new patient record I can pass
the PatientID from the menu form to the Head, etc subform or to view the info
after data entry so that it will only display the information fro one
specific patient?

Here is the code I have used to populate the subform:

Private Sub Option2_DblClick(Cancel As Integer)
Me.sbfFeature.SourceObject = "frmStature"
Me.sbfFeature.Form.AllowAdditions = True
Me.sbfFeature.Form.AllowDeletions = True
Me.sbfFeature.Form.AllowEdits = True
End Sub

Can I set the acAdd as with Docmd.OpenForm or is there something else I have
to do?

Thanks
 
Top