Password

jonnymenthol

Registered User.
Local time
Today, 21:33
Joined
Oct 31, 2001
Messages
58
Hello,

I use the following code to allow deletion of records :

Code:
Private Sub CmdDelete_Click()
    Dim Password
    Dim PassBox
    Dim intmsgresp As Integer
    Dim db As Database
    
    Password = InputBox("Enter Password to Delete Record", "Password")
    If Password = "Admin" Then
    Set db = CurrentDb()
    If Lstcustomers.ListIndex >= 0 Then
        intmsgresp = MsgBox("Delete Record ?", vbYesNo + vbCritical + vbDefaultButton2, "Delete")
        If intmsgresp = vbYes Then
           db.Execute "Delete * from TblMain where ID = " & Lstcustomers & ";"
        Call Countrecords
        End If
    Else
        Beep
        MsgBox ("Please Select a Record First"), vbOKOnly + vbCritical, "Selection Error"
    End If
    Else
        MsgBox "Password Invalid, Access Denied", vbOKOnly + vbCritical, "Invalid Password"
    End If
End Sub

However, when the message box appears, and I type in the password, it appears as text.

How can I get it to show asterisks (*) ?

Thanks.
 
Last edited by a moderator:
jonnymenthol said:
Dim Password
Dim PassBox

As what?


Password = InputBox("Enter Password to Delete Record", "Password")

You can't convert the text to asterisks with an Input Box - the only way to do what you want is to create a form with a textbox (Input Mask set to Password) and use that instead.
 
Further to what Mile-O-Phile said,

The best thing to do is design a pop up form that looks like an input box
 

Users who are viewing this thread

Back
Top Bottom