Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide tab on tab control 3

Status
Not open for further replies.

cbiker

Programmer
Jul 2, 2003
35
US
I have a form with a tabe control that the tabs have subforms that are linked to main form how do I hide tab 1 and tab 3 when cnb check box is checked and show them when it isn't checked. Each record on main form might or mightnot be checked so when you go between records the tabs will be hidden or not.Any help will be appretiated.
 
You need to do a on click on you checkbox:

If Me.Checkbox = True Then ' determines if the checkbox has been ticked
Me.Page2.Visible = False ' hides the relevant pages
Me.Page3.Visible = False ' hides the relevant pages
Else
Me.Page2.Visible = True ' Else if unticked shows the pages
Me.Page3.Visible = True ' Else if unticked shows the pages
End If

When you create the tabs they are called page1, page 2, etc by befault. In design view if you click on each tab it will show its name.

Many Thanks

Tim

If this has helped please remember to show it with a star

Thanks

Tim
 
Hi,

You can hide a page on a tab control with the following

TabCtl.Pages(0).Visible = False

The number in the brackets is the index of the page that you want to hide. Zero = first page, 1 = second, etc.

Hope this helps.





There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top