I have an input box where the user will be typing in a password. How can I get the characters to appear encrypted (i.e. *****) as the user is typing? Thank you.
Dim frmPass as frmPassword
Dim strPassWord As String
.....
Set frmPass = New frmPassWord
strPassWord = frmPass.GetPassword
if Len(strPassWord) then
....cancel out
End if
Put a label, textBox, and two buttons labeld OK and Cancel on the form.
The form contains one function and two subs.
Public Function GetPassword(Optional ByVal Prompt As String = "" As String
lblPassword = Prompt
txtPassword.Passwordchar="*"
Me.Show vbModal ' Modal form, wait for Hide
GetPassword = txtPassword
Unload Me
End Function
Private Sub cmdOK_Click()
Me.Hide ' Release modal
End Sub
Private Sub cmdCancel_Click()
txtPassword = ""
Me.Hide ' Release modal
End Sub
Then in the calling form get the password with
Dim frmPass as frmPassword
Dim strPassWord As String
.....
Set frmPass = New frmPassWord
strPassWord = frmPass.GetPassword("Enter your password"
if Len(strPassWord) then
....cancel out ' nothing entered
End if
hi
put ur text field in the form, and then go to the property window of the this textfield. there u would find a "passwordchar", putin ur desired character used as password character like *.
now on the text property, delete text1.
n thatz it, easy
bye
bilal
bilalbusy@yahoo.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.