is it possible to have a similar procedure for
opening a specific page within a "Ctrl Tab"?
well, pages in a tab control don't "open" and "close", you merely navigate
from one to another. here's one way to stop the uninvited user from moving
to a "protected" tab, as
Private Sub TabCtl0_Change()
If Me!TabCtl0 = 1 Then
If Not InputBox("enter password") = "something" Then
Me!TabCtl0 = 0
MsgBox "sorry, Charlie"
End If
End If
End Sub
in the above example, the name of the tab control is TabCtl. each page in a
tab control has an index value - the first page's index value is 0, the
second page's value is 1, etc. the "value" of the tab control is the index
value of the currently selected tab page. so the above code says: if the
user clicks on the second tab page (which has an index value of 1), an input
box will open for the password to be entered; if the password is not
correct, the first tab page is selected instead; if the password IS correct,
the second tab page is selected as the user intended.
personally, i prefer to not show things to users that they can't actually
get at - it just causes frustration. i'd be more likely to hide the
"password-protected" page, and make it visible only when the correct
password is provided. to do that, you can use a command button, something
along the lines of
Private Sub Command0_Click()
If InputBox("enter the password") = "something" Then
Me!TabPageName.Visible = True
Else
MsgBox "sorry, Charlie"
End If
End Sub
hth