How do I prevent selection of certain pages in a tab control?

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

Guest

I have a tab control each with it's own set of controls. I do not want the
users to be able to select the second and third tabs until certain data is
entered and saved on the first tab. I tried ".enabled = False" and that just
seems to disable the controls on that tab page. What I want it the tab header
to not be selectable (like in VB).

I suppose I could put something in the click event to force the previous
page to appear but I thought that there might be a more straight forward way
to do this.

Kirk
 
Try something like this:

Me!tabCtlName.Pages.Item(0).Visible = False

This will hide the first tab (the 0th item) of a tab control. Setting it to
true shows it.
 
Since Pages are zero-based indexed, you need to use the Index = 1 or 2 for
the second and third Page respectively.
 
Sorry. I have just re-read you post.

If you don't the user to be able to change the Tab Page, you need to set the
Enabled Property of the TabControl to False.

Alternatively, hide the Page(s) and only make it/them visible when
appropriate.

--
HTH
Van T. Dinh
MVP (Access)
 
Back
Top