Visability

T

Tom

I have my form with a multitude of tabbed sub forms at the bottom. I would
like to only have one tab visible, based on the data from one field on the
"Main" part of the form...

How can I do this??

Thanx
Tom
 
M

Mike Painter

Tom said:
I have my form with a multitude of tabbed sub forms at the bottom. I
would like to only have one tab visible, based on the data from one
field on the "Main" part of the form...

How can I do this??

Thanx
Tom
If only one subform is going to be visible at a time you could probably
eliminate the tab control.In the Change Event of The TabControl

Private Sub MyTab_Change()
MyTab.Pages(2).Visible = MyTab.Page<>0
End Sub

From a Pieter Wijnen and posted at eggheadcafe.comYou will also have to set
the focus to that tab.
 
M

Mike Painter

If My!field = some condition then
MyTab.Pages(2).Visible = true
else
MyTab.Pages(2).Visible = fales
end if
 
T

Tom

Maybe getting closer. It isn't working quite right. The tab I try it on is
still visible no matter what the Department field is showing. Also, may not
be puttin g it in the right spot. Don't see a "Change" event on the tab
control.

Working with Acces 2007 and still not comfortable finding my way around.
 
R

Ron2006

It seems to me that you would want to stick that code in the OnCurrent
event of the form itself and in the afterupdate event of the field
that is being used to control which tabs are to be visible.


Ron
 
M

Mike Painter

The code goes in an event for the field that is changing, not on the tab.
The field changes the tab.

In general events "send" information. If they received they would all have
to be firing all the time.

Note also that you may have to make the other tabs invisible and bring the
one you want to the top.
 

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