Results 1 to 6 of 6

Thread: Excel Form Password Entry

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    n ireland
    Posts
    5

    Excel Form Password Entry

    hey guys, my first time on the forum, thanks for the resource-
    simple question -
    can anyone tell me how to make forms work - i want a password hiding (****) thing, and as you cant do that with InputBoxes then i think forms are the only option.

    i can make the form OK, but can anyone tell me how to verify?

    i have a table with headings UserLevel - Password

    any help would be ... helpful!
    btw im using Excel XP version. thanks
    dave

  2. #2
    WorkHorse
    Guest
    Create your UserForm and add a text box to get the password. Set the text box property PasswordChar to "*", or whatever you want to show when users type into the text box.

  3. #3
    Armbruster
    Guest
    On a form . . .

    VB Code:
    1. Option Explicit
    2.  
    3. Public i As Integer
    4.  
    5.  
    6. Private Sub cmdOk_Click()
    7.     i = i + 1
    8.     If i = 3 Then
    9.         MsgBox "Sorry, three strikes and your out!"
    10.         Unload Me
    11.         Exit Sub
    12.     End If
    13.     If txtPassword.Text <> strPword Then
    14.         MsgBox "Incorrect password!" & VBA.vbCr & VBA.vbCr & _
    15.             "Make sure caps lock is not on" & VBA.vbCr & _
    16.             " and try again", vbInformation + vbOKOnly, "Incorrect Password"
    17.         Exit Sub
    18.     Else
    19.         'password succeeded
    20.         'put code here to continue after password success
    21.     End If
    22. End Sub
    23. Private Sub cmdCancel_Click()
    24.     Unload Me
    25. End Sub

    . . . in a module . . .

    VB Code:
    1. Option Explicit
    2.  
    3. Public Const strPword As String = "chickenmcnugget"
    4. 'replace that password with whatever you choose
    5. 'don't forget to password protect your project!!
    6. Sub Get_Password()
    7.     frmPword.Show
    8. End Sub

    . . . and here is the form . . .


    Good luck !


    (I created that form in ExcelXP so you can import it directly into your project)

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    n ireland
    Posts
    5

    import errors.

    not sure why, but the import dies whenever i try it.
    anyone else find that error?
    thanks for the help. if you cant see any error then what's the form say?

    just a "UserName" box and a "Password" Box and a submit button?

    sorry: the error is: (from the log)
    OleObjectBlob = "frmPword.frx":0000

    there's an error in that line of code.
    thats hwat the log gives.
    Last edited by rogueweb; Mar 14th, 2002 at 11:20 AM.

  5. #5
    Armbruster
    Guest
    Wierd!

    Yeah, just:
    txtUsername textbox
    txtPassword textbox
    cmdOk command button
    cmdCancel command button

    set you password character property (at design time) to "*" or whatever

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    n ireland
    Posts
    5

    thanks

    ive got them working on my own now, thanks v. much guys.
    the A-level project is that one extra lickle bit better

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width