Make subforms invisible/visible

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.
 
R

ruralguy via AccessMonster.com

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.
 
C

cuyeda

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.
 
R

ruralguy via AccessMonster.com

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top