Mask for password

G

Guest

Hello,

How would I code for an input mask for a password? I have the following
behind a command button, but I want it to only show asterisks (*), not the
actual password.

Any help would be appreciated.

Private Sub UpdateSummary_Click()

Dim strPasswd

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

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "You must enter a PASSWORD to continue", vbInformation, "Required Data"
Exit Sub
End If

If strPasswd = "Eve's report" Then
Dim stDocName As String
stDocName = "rptSourceCodes_Summary"
DoCmd.OpenReport stDocName, acPreview
Else
MsgBox "Sorry, you do not have access to this report", vbOKOnly, "Important
Information"
Exit Sub
End If
End Sub
 
J

Jeff Conrad

Hi Luther,

You cannot apply a password mask of asterisks on an InputBox, it
simply cannot be done.

You have several options.

1. Create a small pop-up form triggered by the command button
that will have a text box for the user to enter a password. You
can then put the Password input mask on the text box to hide it
as the person is typing.

2. If you need something simple for a single form and/or report you could
try these Microsoft KB articles:

http://support.microsoft.com/?id=209871
http://support.microsoft.com/?id=179371

(Those articles also describe how to arrive at a solution for #1)

3. For the *best* security you should implement User Level Security.
It is a difficult and complex process to grasp the first few times. If
you would like some links on that subject, post back and I'll provide
a few.
 
R

Rob Oldfield

3. For the *best* security you should implement User Level Security.

To clarify.... here *best* means a means that will avoid being immediately
cracked by anyone who knows how to find the shift key. If you want real
security then you have to use ULS at the minimum.
 

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