Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    62

    Unanswered: Password protected command button!

    Hi,
    Is it possible to have a command button linked to a password? For example, if I want to have a button on a form that only certain users can have access too, when they click on the button, access will ask for a password and open the underlying form. Otherwise access will be denied?

    Is this possible?
    cheers,

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Without knowing where the password is stored, here's a hard-coded pseudo example.
    Code:
    Dim pwd As String
    
    pwd = InputBox("Please enter password", "Secure")
    
    If pwd = "123abc" Then
        MsgBox ("correct password")
    Else
        MsgBox ("Incorrect password")
    End If
    I would not advise that you hard code the password, it's very poor design and will cause you problems.

    Alternatively if you're using integrated security you can do stuff like this with no problems - check the helpfiles when creating groups.

    Meh.
    George
    Home | Blog

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Is this http://www.dbforums.com/showpost.php...0&postcount=20 something you were looking to do?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    If you do decide to use the simple sample George has so generously pointed out then do keep in mind that the InputBox does not mask the characters you type...so make sure no one is looking over your shoulder.

    There is a work round to this if you want to use the InputBox and it's in this forum....somewhere. Using API you can mask the input entry into a InputBox.

    Cool samples Paul.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  5. #5
    Join Date
    Dec 2007
    Posts
    1
    Quote Originally Posted by CyberLynx
    If you do decide to use the simple sample George has so generously pointed out then do keep in mind that the InputBox does not mask the characters you type...so make sure no one is looking over your shoulder.

    There is a work round to this if you want to use the InputBox and it's in this forum....somewhere. Using API you can mask the input entry into a InputBox.

    Cool samples Paul.

    .
    What can you put to mask it?

  6. #6
    Join Date
    Nov 2003
    Posts
    1,487
    Here is yet again the sample I provided a little while ago. Read the code comments inside.

    .
    Attached Files Attached Files
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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