Subform Visibility

G

Guest

Hello,

I need to control visibility on 3 different subforms that are stacked on top
of each other. What I want to happen is when button 1 is clicked, subform 1
becomes visible. Button 2 click makes subform 2 visible, etc.

How can this be done using VB if I have the following:

Trinity ( Main Form Name )
btnOne, btnTwo, btnThree ( Button Names )
sfrOne, sfrTwo, sfrThree ( Subform Names )

Any help will be greatly appreciated!

-Simon
 
M

Marshall Barton

Simon said:
I need to control visibility on 3 different subforms that are stacked on top
of each other. What I want to happen is when button 1 is clicked, subform 1
becomes visible. Button 2 click makes subform 2 visible, etc.

How can this be done using VB if I have the following:

Trinity ( Main Form Name )
btnOne, btnTwo, btnThree ( Button Names )
sfrOne, sfrTwo, sfrThree ( Subform Names )


Note that it doesn't matter what the name of the form is.
You have to work through the subform **control** that is
used to display the form. (The form displayed in a subform
control is specified in the subform control's SourceObject
property.

Assuming the name of the subform control is the same as the
name of the form it is displaying, the code for btnOne would
be:
Me.sfrTwo.Visible = False
Me.sfrThree.Visible = False
Me.sfrOne.Visible = True
 

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