Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
E-J E-J is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protect GeoSte New Users to Excel 1 January 8th 08 07:15 PM
VBA password protect brian thompson3001 via OfficeKB.com New Users to Excel 1 July 16th 06 07:23 PM
password protect ravi Excel Programming 1 August 4th 05 07:23 PM
password protect Jim W via OfficeKB.com Excel Discussion (Misc queries) 2 July 24th 05 12:26 AM
Password protect crapit Excel Programming 2 June 13th 04 01:15 PM


All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"