Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden Password

Status
Not open for further replies.
Jul 4, 2004
42
0
0
GB
Hi.

I am using the following code to disable the Shift Key on Start Up. Unfortunately when I type in the password the words are visable. I need the words to appear ******** like you can on Tables.

Here is the code. Thanks in advance for any help.


Private Sub bDisableBypassKey_Click()

On Error GoTo Err_bDisableBypassKey_Click
Dim strInput As String
Dim strMsg As String
Beep
strMsg = "This Database Is Locked" & vbCrLf & vbLf & _
"To Unlock Enter the Password."
strInput = InputBox(prompt:=strMsg, title:="Disable Bypass Key Password")
If strInput = "THEPASSWORD" Then
SetProperties "AllowBypassKey", dbBoolean, True
Beep
MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
"The Shift key will allow the users to bypass the startup options the next time the database is opened.", _
vbInformation, "Set Startup Properties"
Else
Beep
SetProperties "AllowBypassKey", dbBoolean, False
MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
"The Bypass Key was disabled." & vbCrLf & vbLf & _
"The Database is Locked"_
vbCritical, "Invalid Password"
Exit Sub
End If
Exit_bDisableBypassKey_Click:
Exit Sub
Err_bDisableBypassKey_Click:
MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
Resume Exit_bDisableBypassKey_Click

End Sub
 
I think you will need a small form, rather than an Inputbox. I do not think you can use the password format with an Inputbox, but you can with a form. If you open the form with the Window Mode set to acDialog, it will be Modal and Pop-Up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top