using tab control

G

Guest

I am using a tab control on a form. I am using regular buttons to make the
change to the appropriate tab control page. The tabs are still being used
but as a way to organize the information. I have several questions regarding
the tab control.

1) I can not find as to the limit of tabs that can be used on a tab
control. If anyone knows, please let me know before I get to carried away
with the tab control.

2) Even tho the tabs are used, they are invisible when not in use. What I
would like to do is when a button's click event is run, make all the tabs
that are currently visible invisible and show only the tabs associated with
clicked button. The making visible part I have gotten. It is the making the
current visible tabs invisible. Any given set of tabs can be visible when a
button is selected to bring another set of tabs visible. The button
selection can be a random event so hiding and showing tabs will also be
random.

Is there a general code that will make visible tabs invisible?

Thanks to anyone who responds.

*** John
 
G

Guest

Regarding (2), you wont be able to make a tab invisible using a button on the
tab. Your button will have to be outside the tab control.
The code to use is:
Me!tabName.visible = False

- Dorian
 
G

Guest

Dorian, thanks for the comeback. I should have indicated that the buttons
are not on the tab control. When I select a button, whatever current tab
pages are visible I would like to invisible and the new selected one(s)
appear. The appear part I can do. It is taking whatever existing tab page
is visible to go invisible.
*** John
 
G

George Nicholson

Maybe something like:

For p = 0 to Forms("frmMain").tabMain.Pages.Count-1
if Forms("frmMain").tabMain.Pages(p).visible then
Forms("frmMain").tabMain.Pages(p).visible = false
next p

You could also probably use a "For each pg in Pages" loop structure, but
I've never actually used it in this context. No reason it shouldn't work
though.

In either case, the focus has to be somewhere other than your tab control or
the loop will fail.

HTH,
 

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