LIMITING WHAT TABS ARE DISPLAED ON TAB CONTROL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form with a combo box. I want the tab displayed in the tab
control to depend on the selection made in the combo box. Ideally I would
also be able to restrict access to the other tabs on the form as well.

Any ideas?


Ed
 
Create a column in you combobox that holds the name of the page you
want made visible. This might come from your table or from a value
list. Then in the AfterUpdate of the combobox, put this code:

Dim objPage As Page
' Make all pages invisible.
For Each objPage In Me.MyTabCtl.Pages
objPage.Visible = False
Next
' Set the selected page to Visible. This assumes that the page
name column is the second column in the combobox..
Me.MyTabCtl.Pages(Me.cboCombo.Column(1)).Visible = True

HTH,
Barry
 

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

Similar Threads

Tab Controls 6
Refreshing tab control 2
28 tabs 2
Tab Control 2
search causes tab selection 2
Requery on a Tab Control - OnClick 3
Moving Subform to Tab Control 3
Tab Order 4

Back
Top