By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Password protection

P: 76
Hello,

I have visual basic code tied to a command button that requires a password before opening a form. When the password is entered, it appears as typed rather than as "******" or something like that. Is there any way to hide what is being typed?

Below is the code that I'm currently using.

Thanks,

Charlie

Private Sub Command52_Click()
'Attached to On Click event of Command52

Dim strPasswd

strPasswd = InputBox("Enter 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 = "EC6573" Then
DoCmd.OpenForm "EmiCan T", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
Oct 10 '06 #1
Share this Question
Share on Google+
1 Reply


100+
P: 143
Yeah, don't use an input box, change it to a text box and set the Input Mask property to Password.
Oct 11 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.