I have a subform that I want to use in many forms. However, I don't want the same exact text fields to be displayed in some forms. Am I better off creating a copy of this subform and deleting these fields and inserting them into the specific forms. Or is it possible to code:
if subform is in this form then
do not display
I would try to reuse the same subform for all of the forms. Unless it gets too complicated or space on a form is limited and you need the space that would be wasted by the control(s) that are invisible.
You can go at it a couple of ways. You can put the code in the subform and check to see what form you are in using Me.Parent.Name. Or you can put the code in each form that needs to hide some of the controls. To get to the controls use Me.subformname.Form.Controls(ControlName).Visible. I would put the code in the Open Event of the form.