progressiverookie
Technical User
Hi,
I'm using the following code to attach a password to a command button; however, when the person enters the password, it is not hide with *********, it actually displays what the person types. How can I adjust my code below to hide what they are typing.
*****************CODE START****************
Private Sub Continue_Click()
'Attached to On Click event of Admin Password
Dim strPasswd
strPasswd = InputBox("Enter Administrator's Password", "Restricted Form")
'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.
If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If
'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub
If strPasswd = "password" Then
DoCmd.OpenForm "Administrator Menu", acNormal
Else
MsgBox "Sorry, you do not have access to this form!", vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
******************CODE END*****************
Thanks in advance.
Jeremy
I'm using the following code to attach a password to a command button; however, when the person enters the password, it is not hide with *********, it actually displays what the person types. How can I adjust my code below to hide what they are typing.
*****************CODE START****************
Private Sub Continue_Click()
'Attached to On Click event of Admin Password
Dim strPasswd
strPasswd = InputBox("Enter Administrator's Password", "Restricted Form")
'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.
If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If
'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub
If strPasswd = "password" Then
DoCmd.OpenForm "Administrator Menu", acNormal
Else
MsgBox "Sorry, you do not have access to this form!", vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
******************CODE END*****************
Thanks in advance.
Jeremy