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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change Inputbox Caption? 1

Status
Not open for further replies.

marceloBR

Technical User
Jul 18, 2001
2
BR
Hello guys!
If you give a little look to the code below, you'll see that it's a password code. My problem is when I run this code I can see the password typed at the InputBox.
I had tried many times to change the charachters, but I couldn't. Do you know any solution?
P.S.: I'm a begginner.
Thanks,
Marcelo.

Private Sub Approved_Exit(Cancel As Integer)
Dim SN
Set DB = OpenDatabase("c:\MyDocuments\psswd.mdb")
Set rsFunc = DB.OpenRecordset ("Password",dbOpenDynaset)
Approved.SetFocus
SN = InputBox("Password", "Password")
If SN = rsFunc!Password Then
MsgBox "Ok let's go!", vbInformation, "Password ok"
Else
MsgBox "Do you know the password?...", vbExclamation, "Incorrect Password"
Approved.SetFocus
Approved.Text = ""
se.SetFocus
End If
End Sub


Private Sub Change_Click()
On Error GoTo Err_Change_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim Chg
Dim New
Dim Cfrm

Set DB = OpenDatabase("c:\MyDocuments\psswd.mdb")
Set rsFunc = DB.OpenRecordset("password", dbOpenDynaset)

Chg = InputBox("Actual Password", "Check-up")
If Not Chg = rsFunc!Password Then
MsgBox "Incorrect password! Try again.", vbOKOnly, "Incorrect Password"
Else
New = InputBox("New Password", "New")
If New = rsFunc!Password Then
MsgBox "You are using this password, try another one!", vbOKOnly, "Error"
Else
Cfrm = InputBox("Confirm new password", "Confirm")
If Cfrm = New Then
rsFunc.Edit
rsFunc!Password = Cfrm
rsFunc.Update
MsgBox "Password was successfully changed!", vbExclamation, "OK!"
Else
MsgBox "Try again...", vbOKOnly, "Incorrect Password"
End If
End If
End If

Exit_Change_Click:
Exit Sub

Err_Change_Click:
MsgBox Err.Description
Resume Exit_Change_Click

End Sub








 
You can't change the characters to not display using an InputBox. You'll have to create a form with a control set to display password characters and open the form when needed to do this.

HTH Joe Miller
joe.miller@flotech.net
 
hi,
take a look at the thread in this forum by zvew (posted 07/24) about an "inputbox with asterisks". I proposed an answer in there... maybe you can use it too, if not, be sure to reply!

cpuburn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top