Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
passwords
i have created a wizard that sets up projects that come into my office. i
have required the user to fill in all of the text boxes. this is accomplished through the code below, which is executed when the Finish Button is pressed: For Each MyCtrl In Me.Controls If TypeName(MyCtrl) = "TextBox" Then If MyCtrl.Value = "" Then If MyCtrl.Enabled = True Then MsgBox "You Did not Enter all of the Required Data " & MyCtrl.Name MultiPage1.Value = 0 Exit Sub End If End If End If Next i want to include an override option in case all of the text boxes cannot be filled in. so when the user presses finish, i prompt them that they missed a text box. then i want to give them an option of entering a password to disable this feature. how can i write code to prompt them for a password, and if they enter it correctly, this part of the code is disabled? Thanks, STeve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
passwords
Where Pword is a password declared elsewhere in your code. If you don't want
people to see it when you type it in, you could set up a textbox on your form (or set up another form that is called by this macro to request the password) and use the PasswordChar property of the textbox to show some other character (such as "*") For Each MyCtrl In Me.Controls If TypeName(MyCtrl) = "TextBox" And _ MyCtrl.Value = "" And _ MyCtrl.Enabled Then If InputBox("Enter Password") < Pword Then MsgBox "You Did not Enter all of the Required Data " _ & MyCtrl.Name MultiPage1.Value = 0 Exit Sub End If End If Next "steve" wrote: i have created a wizard that sets up projects that come into my office. i have required the user to fill in all of the text boxes. this is accomplished through the code below, which is executed when the Finish Button is pressed: For Each MyCtrl In Me.Controls If TypeName(MyCtrl) = "TextBox" Then If MyCtrl.Value = "" Then If MyCtrl.Enabled = True Then MsgBox "You Did not Enter all of the Required Data " & MyCtrl.Name MultiPage1.Value = 0 Exit Sub End If End If End If Next i want to include an override option in case all of the text boxes cannot be filled in. so when the user presses finish, i prompt them that they missed a text box. then i want to give them an option of entering a password to disable this feature. how can i write code to prompt them for a password, and if they enter it correctly, this part of the code is disabled? Thanks, STeve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
passwords
Thanks....i set up another userform, and passed along a public variable named
'PasswordOK' "JMB" wrote: Where Pword is a password declared elsewhere in your code. If you don't want people to see it when you type it in, you could set up a textbox on your form (or set up another form that is called by this macro to request the password) and use the PasswordChar property of the textbox to show some other character (such as "*") For Each MyCtrl In Me.Controls If TypeName(MyCtrl) = "TextBox" And _ MyCtrl.Value = "" And _ MyCtrl.Enabled Then If InputBox("Enter Password") < Pword Then MsgBox "You Did not Enter all of the Required Data " _ & MyCtrl.Name MultiPage1.Value = 0 Exit Sub End If End If Next "steve" wrote: i have created a wizard that sets up projects that come into my office. i have required the user to fill in all of the text boxes. this is accomplished through the code below, which is executed when the Finish Button is pressed: For Each MyCtrl In Me.Controls If TypeName(MyCtrl) = "TextBox" Then If MyCtrl.Value = "" Then If MyCtrl.Enabled = True Then MsgBox "You Did not Enter all of the Required Data " & MyCtrl.Name MultiPage1.Value = 0 Exit Sub End If End If End If Next i want to include an override option in case all of the text boxes cannot be filled in. so when the user presses finish, i prompt them that they missed a text box. then i want to give them an option of entering a password to disable this feature. how can i write code to prompt them for a password, and if they enter it correctly, this part of the code is disabled? Thanks, STeve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passwords | Excel Discussion (Misc queries) | |||
Passwords | Excel Programming | |||
passwords | Excel Programming | |||
Passwords | Excel Programming | |||
VBA and Passwords? | Excel Programming |