Password on a field

D

David

How can a make the password on just a field show up as *
when it is keyed in? This is what I am using now, but
when the password is keyed in the actual password "temp"
is visible.
Private Sub Z2SP_GotFocus()
Dim MsgStr As String, PassStr As String
MsgStr = "Enter your password."
PassStr = InputBox(Prompt:=MsgStr) ', Title:="User
Info", XPos:=100, YPos:=100)
Z2SP.Locked = True
If PassStr = "temp" Then
Z2SP.Locked = False
Else
MsgBox "Incorrect password"
End If
End Sub
 
L

Lynn Trapp

I don't think you will ever have any luck trying to format the inputbox
function. However, if you create your own form, you can use the Password
input mask for a textbox.
 
R

Rick Brandt

David said:
How can a make the password on just a field show up as *
when it is keyed in? This is what I am using now, but
when the password is keyed in the actual password "temp"
is visible.
Private Sub Z2SP_GotFocus()
Dim MsgStr As String, PassStr As String
MsgStr = "Enter your password."
PassStr = InputBox(Prompt:=MsgStr) ', Title:="User
Info", XPos:=100, YPos:=100)
Z2SP.Locked = True
If PassStr = "temp" Then
Z2SP.Locked = False
Else
MsgBox "Incorrect password"
End If
End Sub

Give the control an InputMask of "Password" (without the quotes)
 
R

Rick Brandt

Rick Brandt said:
Give the control an InputMask of "Password" (without the quotes)

Check that. I didn't see before that you are using an InputBox. A TextBox on a form
can use an InputMask of Password to show asterisks as you type, but the InputBox
cannot do that. You would need to replace with a form of your own.
 

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