View Single Post
  #4  
Old December 20th, 2006, 04:01 PM posted to microsoft.public.access.forms
BruceM
external usenet poster
 
Posts: 723
Default SubForm Visibility

You could set the Visible property of one subform control to True and of the
other to False, then use code like this in a command button's Click event:

Me.SubformControl1.Visible = Not Me.SubformControl1.Visible
Me.SubformControl2.Visible = Not Me.SubformControl2.Visible

You could also put one subform on top of the other. Set the visible
property of one to True and the other to False. If SubformControl2 has the
visible property set to False, your command button code could be:

Me.SubformControl2.Visible = Not Me.SubformControl2.Visible

There are other options too, depending on your needs, but the syntax is the
same. Use your actual subform control names, which may be different from
the form names if you created the subforms separately. To see the name of
the subform control, click the very edge of the subform so that small
rectangular "handles" appear at the corners and in the middle of each edge,
then click View Properties. The property sheet that appears will say
Subform/Subreport followed by a name that also appears on the Other tab of
the property sheet. This is the name you need to use in the command button
code.

Or you many find that a tab control (with file tabs like the property sheet)
gives you what you need.

"Julia CHP" wrote in message
...
Hello-

I would like to design a form for data entry which, when a button is
clicked, a specific sub-form is loaded/visible.

I have 2 sub-forms that need to be completed, however I want the user to
be
able to toggle between the two.

However, I don't want the user to be able to see the sub-form that they do
not need to use until they are ready to use it.

So- I'd like my toggle button to make either the one form visible, OR the
other form visible, but not both at the same time.

Thanks.