Password protection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ckpoll2
    New Member
    • Sep 2006
    • 76

    Password protection

    Hello,

    I have visual basic code tied to a command button that requires a password before opening a form. When the password is entered, it appears as typed rather than as "******" or something like that. Is there any way to hide what is being typed?

    Below is the code that I'm currently using.

    Thanks,

    Charlie

    Private Sub Command52_Click ()
    'Attached to On Click event of Command52

    Dim strPasswd

    strPasswd = InputBox("Enter Password", "Restricted Form")

    'Check to see if there is any entry made to input box, or if
    'cancel button is pressed. If no entry made then exit sub.

    If strPasswd = "" Or strPasswd = Empty Then
    MsgBox "No Input Provided", vbInformation, "Required Data"
    Exit Sub
    End If

    'If correct password is entered open Employees form
    'If incorrect password entered give message and exit sub

    If strPasswd = "EC6573" Then
    DoCmd.OpenForm "EmiCan T", acNormal
    Else
    MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
    Exit Sub
    End If
    End Sub
  • Tanis
    New Member
    • Mar 2006
    • 143

    #2
    Yeah, don't use an input box, change it to a text box and set the Input Mask property to Password.

    Comment

    Working...