Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a way to password protect a combobox?
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a way to password protect a combobox?
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a way to password protect a combobox?
Thankyou thankyou thankyou
Dave Peterson you are a champ "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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
I need a way to password protect a combobox?
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Password protect | New Users to Excel | |||
VBA password protect | New Users to Excel | |||
password protect | Excel Programming | |||
password protect | Excel Discussion (Misc queries) | |||
Password protect | Excel Programming |