Form

B

bdehning

I have a Form which has a subform and the subform has a subform.

What do I need to do so that the last subform is not visible when the main
form is opened but if a command button is selected on the main form the last
subform opens at the bottom of the form?
 
R

Rick Brandt

bdehning said:
I have a Form which has a subform and the subform has a subform.

What do I need to do so that the last subform is not visible when the
main form is opened but if a command button is selected on the main
form the last subform opens at the bottom of the form?

Initially set the sub-subform control's visible property to False and then in
the Click event of the button...

Me!SubformControlName.Form!SubSubformControlName.Visible = True
 
B

bdehning

Of course this is not easy with subforms and I am not great this. I keep
getting errors.

If my Main form is [Account Location Test] and the first subform is
[Location Update Test]. The subform I want to make visible is [Service Calls
Update]

What code do I need to make this work. I need something with Forms! correct
that ties in all forms?

Do I need more than what you provided earlier?
Me!SubformControlName.Form!SubSubformControlName.Visible = True
 
S

Steve Schapel

Brian,

Then, to "translate" Rick's template to your specifics...
Me![Location Update Test].Form![Service Calls Update].Visible = True
 
B

bdehning

Steve and Rick, Yes I just figured it out before your post so thanks and now
on to my next issue.

Thanks again.

Steve Schapel said:
Brian,

Then, to "translate" Rick's template to your specifics...
Me![Location Update Test].Form![Service Calls Update].Visible = True

--
Steve Schapel, Microsoft Access MVP

Of course this is not easy with subforms and I am not great this. I keep
getting errors.

If my Main form is [Account Location Test] and the first subform is
[Location Update Test]. The subform I want to make visible is [Service Calls
Update]

What code do I need to make this work. I need something with Forms! correct
that ties in all forms?

Do I need more than what you provided earlier?
Me!SubformControlName.Form!SubSubformControlName.Visible = True
 
R

Rick Brandt

bdehning said:
Steve and Rick, Yes I just figured it out before your post so thanks
and now on to my next issue.

Thanks again.

One thing to keep in mind with this is that the syntax for these references use
the name of the subform *control*, not the name of the form within (unless they
are the same).

If you add a subform by dragging a form from the db window onto the design view
of another form or by using the wizard then the subform control will likely end
up with the same name as the form contained within it. If that control name is
not already in use then that is what Access will name it, but there are
circumstances where this WON'T be true.
 
Top