I need a way to password protect a combobox?

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

Guest

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.
 
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.
 
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
 
This code is behind a userform--not behind a button on a worksheet.

What did you mean by a multipage control?
 

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

Back
Top