Hi Bill
You don't mention what the problem is. Does this not work? Do you get any
error message?
Is the tab control on a subform, or is IR_Main the main form? If the latter
then your reference is invalid. You should just say:
Me.TabCt176.Pages(2).Visible = True
(Note the .Item is unnecessary)
A few other (gratuitous) tips
1. Use the AfterUpdate event, not the Click event
2. Always rename a control to something meaningful after creating it.
"TabCt176" and "Check122" mean nothing, so rename them to, say, "tbcOptions"
and "chkShowWidgetsPage".
3. The page with index number 2 will have its own name, say "tpgWidgets", so
you can avoid future problems by referring to it by name:
Me.tpgWidgets.Visible = True
Also, you cannot hide a tab page if the current focus is on a control on
that page, so you should .SetFocus to another control first if necessary.
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Bill said:
OK I've been working on a form that displays a tab only when a box it
checked. How can I do this?
Private Sub Check122_Click()
If Me!Check122 = True Then
Me.Form_IR_Main.TabCt176.Pages.Item(2).Visible = True
Else
Me.Form_IR_Main.TabCt176.Pages.Item(2).Visible = False
End If
End Sub