+ Reply to Thread
Results 1 to 4 of 4

Password protecting a user form

Hybrid View

ducecoop Password protecting a user... 11-22-2008, 05:20 PM
shg Bring up another form with a... 11-22-2008, 05:25 PM
ducecoop Thank you - I will try... 11-23-2008, 08:16 PM
royUK Just use the UserForm... 11-24-2008, 04:53 AM
  1. #1
    Forum Contributor
    Join Date
    10-16-2008
    Location
    San Diego
    Posts
    109

    Password protecting a user form

    How would I code a button on a userform to request a password input before opening the form?

    And as a second level of protection - can I code it to only display asterick's when typing in the password.

    Any help here will be appreciated.

    Thanks in advance
    Dave
    Last edited by ducecoop; 11-23-2008 at 08:16 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Bring up another form with a textbox for the user to enter a password. See Help for the PasswordChar property of a TextBox control.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    10-16-2008
    Location
    San Diego
    Posts
    109
    Thank you - I will try looking at that

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Just use the UserForm intialize event

    Option Explicit
    
    Private Sub UserForm_Initialize()
        Const pw   As String = "secret"    '<- change this
        Dim ans
    
        ans = Application.InputBox("Enter password to continue")
        If pw = "" Or ans <> pw Then Unload Me
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1