Make subforms invisible/visible

  • Thread starter Thread starter cuyeda
  • Start date Start date
C

cuyeda

Can I code an event procedure to make a subform visible or not visible? For
example, if a user clicks a button on the main form the subform
appears/disappears?

I don't know how to do this aside from manually using the property box for
the subform control.
 
A SubFormControl has a Visible property. The click event of your commabd
button on the Main form would be: Me.SubFormControl.Visible = Not Me.
SubFormControl.Visible
...to make the SubForm toggle the visibility on and off.
 
This works - but what if the event procedure occurs within the subform
(rather than in the main form). Then what is the syntax? I tried

Me.Visible=False and
[forms]![main form]![subform control].Visible = False

But neither of these work?

Thanks.
 
That was not your original question but you will have trouble hiding a
control with the focus anyway.
This works - but what if the event procedure occurs within the subform
(rather than in the main form). Then what is the syntax? I tried

Me.Visible=False and
[forms]![main form]![subform control].Visible = False

But neither of these work?

Thanks.
A SubFormControl has a Visible property. The click event of your commabd
button on the Main form would be: Me.SubFormControl.Visible = Not Me.
[quoted text clipped - 7 lines]
 
Back
Top