Password on a field

  • Thread starter Thread starter David
  • Start date Start date
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
 
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.
 
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)
 
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.
 
Back
Top