Password help with *****

O

oxicottin

Hello, I have the code below for a btn and it works well but you can see the
password when you type it in. What and where do I need to add to this code to
have an **** instead of seeing the pasword? Thanks!!

Private Sub Command44_Click()
Dim strPasswd

strPasswd = InputBox("Please Enter Password", "Restricted Form")

'See if a valid entry made to input box

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'correct password is entered open Main form Close, Opening Sheet

If strPasswd = "123" Then
DoCmd.OpenForm "frm_UpdateEmployeeInformation", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important
Information"
Exit Sub
End If

End Sub
 
K

Keith Wilby

oxicottin said:
Hello, I have the code below for a btn and it works well but you can see
the
password when you type it in. What and where do I need to add to this code
to
have an **** instead of seeing the pasword? Thanks!!

No code required. Set the input mask property of the txt box to "password".

Regards,
Keith.
www.keithwilby.com
 
K

Keith Wilby

oxicottin said:
There is no input mask its on a button.

Sorry, I misread. I don't think you can mask the text in an input box,
you'd need to do this on an unbound form using a text box with an input
mask.

Keith.
 
K

Keith Wilby

oxicottin said:
How would that be done? Im new to Access... Thanks for the reply!!

Put an unbound text box on your form and name it "txtPassword". Go to the
input mask property on the properties palette and select "password". Modify
your code to look at the text box instead of an input box (untested):

Dim strPasswd As String

MsgBox "Please Enter Password"
Me.txtPassword.SetFocus

strPasswd = Me.txtPassword

HTH - Keith.
www.keithwilby.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top