Hiding password in pop up dialogue box

M

Martin Hopkins

Hello,

I have a commnd button on a form that opens an admin area and that is
"protected" by a password. The user clicks on the command buttonnand a
dialogue box pops up asking for password. If it is entered coorectly then
the form then opens. Otherwise they are declined acces:

The core bit of the script is:

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 "Incorrect password or no password at all, your attempt to Log In has
been recorded!!!", 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 = "Version7" Then
DoCmd.OpenForm "frmMasterAdmin", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important
Information"

But when the password is entered anybody around can see the password as it
is typeed into the box.

Is there a way of hiding the pasasword for example with ******* as it is
typed?

Thanks for any help.

Martin hopkins
 
R

Rick Brandt

Martin said:
Hello,

I have a commnd button on a form that opens an admin area and that is
"protected" by a password. The user clicks on the command buttonnand a
dialogue box pops up asking for password. If it is entered coorectly
then the form then opens. Otherwise they are declined acces:

The core bit of the script is:

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 "Incorrect password or no password at all, your attempt to Log
In has been recorded!!!", 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 = "Version7" Then
DoCmd.OpenForm "frmMasterAdmin", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly,
"Important Information"

But when the password is entered anybody around can see the password
as it is typeed into the box.

Is there a way of hiding the pasasword for example with ******* as it
is typed?

I recall someone once posted some API code that allowed one to use the asterisk
mask on an InputBox. Short of finding that what most developers would recommend
is to use a separate popup dialog form instead of the InputBox. Then you can
use the standard password InputMask to hide the typed characters.
 

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