#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default 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
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
Passwords dhightow Excel Discussion (Misc queries) 0 April 24th 06 08:22 PM
Passwords Black Jack Excel Programming 1 June 29th 05 03:03 AM
passwords [email protected] Excel Programming 1 February 3rd 05 08:04 PM
Passwords pajodublin Excel Programming 2 November 18th 03 01:39 PM
VBA and Passwords? Pat Beck Excel Programming 0 August 25th 03 08:15 PM


All times are GMT +1. The time now is 11:06 AM.

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"