Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a Password to **** when typing it into Input Box 1

Status
Not open for further replies.

JRA

Programmer
Apr 19, 2001
106
0
0
CA
How do I set a password to display a * for each letter input to the input box rather than displaying the actual password?
 

In the Text Box properties set the Input Mask to "PASSWORD". Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
Actually ... I've set up my password to be entered via an Input Box. How do I change the Input Mask when there are no accessable properties? Can I do it through code?
 
An InputBox does not have a Password Masking facility. I had to create a form, put a textbox on it and set the PasswordChar to "*"
Code:
    strPassword = frmPassword.GetPassword("CICS wants your Password")
'=====================================
' frmPassword Module
'=========================
' Lable
' TextBox
' OK and Cancel Button control array
Option Explicit
Public Function GetPassword(Optional ByVal strPrompt As String = "") As String
    lblPassword = strPrompt
    Me.Show 1   ' Modal form, wait for Hide
    GetPassword = txtPassword
    Unload Me
End Function
Private Sub cmdOKCancel_Click(Index As Integer)
    If cmdOKCancel(1).Value Then
        txtPassword = ""
    End If
    Me.Hide   ' Release modal
End Sub


Private Sub Form_Unload(Cancel As Integer)
    Set frmPassword = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top