Making tab control pages invisible or disabled

sametch

Registered User.
Local time
Today, 14:06
Joined
Feb 17, 2003
Messages
40
I have a number of tabbed pages on a form. Not all are needed at all times. I would like to be able to disable or make invisible non relavent tab pages depending upon the selection of a combo box outside the tab suing VBA.

I am using Access 2000.

Is this possible?

If so could someone please advise how to reference the object and its properties?

Sametch:confused:
 
Yes it is possible!
The way to reference to it is by it's name. (To see it's name, go in creation mode and right-click on the tab. Choose properties then click on the last tab (ALL). There, you have it: first one.

To use the enabled and visible properties:

NameOfTheTab.Enabled=True
NameOfTheTab.Enabled=False
NameOfTheTab.Visible=True
NameOfTheTab.Visible=False

Voila!
 
Thanks Newman

That works fine. I also found out you can reference them by their index number as in:

MyTab.Pages(1).visible where 1 is the index number.

Sametch
 
Using the name instead of the index would help you remember which is which later on.
Let say that in two years, you (or even worst, someone else) come across that code:
Code:
MyTab.Pages(4).Visible = True
Which one is it?
But if you use my code:
Code:
EmployeeAdress.Visible = True
You'll know right away which tab it is.
 

Users who are viewing this thread

Back
Top Bottom