View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default I need a way to password protect a combobox?

This code is behind a userform--not behind a button on a worksheet.

What did you mean by a multipage control?

pgarcia wrote:

Hello agian.
Ok, I'm just novis and your intructions seem easy, but I can seem to get
this to work. How to you show the button on tab one?

Thanks

"Dave Peterson" wrote:

How about adding a button to the form that asks for a password:

I had this under Userform1 (with the multipage control--with on page named
Admin):

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
If Me.MultiPage1.Pages("admin").Visible = False Then
UserForm2.Show
End If
End Sub
Private Sub UserForm_Initialize()
Me.MultiPage1.Pages("admin").Visible = False
End Sub


This code went behind Userform2 (the password form):

Option Explicit
Private Sub CommandButton1_Click()
Dim myPwd As String
myPwd = "ok"
UserForm1.MultiPage1.Pages("admin").Visible _
= CBool(Me.TextBox1.Value = myPwd)
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.TextBox1.PasswordChar = "*"
End Sub

I changed the (Name) property to Admin in the properties window when that tab
was selected.

E-J wrote:

I need a way to password protect a control so that when it is clicked the
user is faced with a dialog box asking to enter password. The control is a
single page on a multipage control. The other pages I want to be made
available exept the "ADMIN" page.


--

Dave Peterson


--

Dave Peterson