Password mask in code

matthewnsarah07

Registered User.
Local time
Yesterday, 22:33
Joined
Feb 19, 2008
Messages
192
I am currently using the code pasted below, it simply pops up a box on click and checks the password entered. Problem is that when you type in the password you can see it on screen. I know on forms there is a password input mask - how can i right this same thing in to code so the typing appears as '****' etc.

Code used:

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim strPasswd

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


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


If strPasswd = "nwrcc" Then
stDocName = "OM Page"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Sorry, you do not have access to this form", _
vbOKOnly, "Important Information"
Exit Sub
End If

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub


Any ideas?
 
I know on forms there is a password input mask - how can i right this same thing in to code so the typing appears as '****' etc.
You cannot...

Easy way around this is to make a popup form with the password mask on it and check the password there.
 
Thanks for your quick reply

Could you tell me how I could edit this code in order for it to check the password against what has been entered into a pop up form - for now called frmpassword?

Thanks for your help
 
You have this code behind a button....

Take this code put it on a new form and have a control on the form for the password entry...
Then instead of the Inputbox "popup" you should read the control using something like
Me.txtPassword (presuming the control name is txtPassword)
To fetch the PW

I hope I was clear enough
 

Users who are viewing this thread

Back
Top Bottom