G
Garyj
Guest
I have a form that I have password protected with the following code. This code works however, when it prompts for the password to be entered into the input box the password shows. How do I get it now to show the actual password just ********* when typing.
Thank you in advance
Code:
Private Sub Form_Open(Cancel As Integer)
Dim Hold As Variant
Dim tmpKey As Long
Dim I As Integer
Dim rs As Recordset
Dim db As Database
On Error GoTo Error_Handler
' Check to see if the user is passing in the Password.
Hold = InputBox("Please Enter Your Password", "Enter Password")
' Open the table that contains the password.
Set db = CurrentDb
Set rs = db.OpenRecordset("tblPassword", dbOpenTable)
rs.Index = "PrimaryKey"
rs.Seek "=", Me.Name
If rs.NoMatch Then
MsgBox "SORRY SYSTEM WAS UNABLE TO LOCATE PASSWORD INFO. PLEASE TRY AGAIN"
Cancel = -1
Else
' Test to see if the key generated matches the key in
' the table; if there is not a match, stop the form
' from opening.
'If Not (rs![KeyCode] = KeyCode(CStr(Hold))) Then
If Not (CStr(rs![KeyCode]) = Hold) Then
MsgBox "SORRY YOU HAVE ENTERED AN INCORRECT PASSWORD." & _
"PLEASE TRY AGAIN.", vbOKOnly, "INCORRECT PASSWORD"
Cancel = -1
End If
End If
rs.Close
db.Close
Exit Sub
Error_Handler:
MsgBox Err.DESCRIPTION, vbOKOnly, "Error #" & Err.Number
Exit Sub
End Sub
Thank you in advance
Last edited by a moderator: