Results 1 to 11 of 11
  1. #1
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28

    Password protect a form

    Is there a way to set a password on a form? I have a form that opens via a macro set to a command button. I need the form to be available on a banner but restrict its contents to those with a passwrod. This obviously is in a multiple user environment. I am not a novice but I am not a VB programmer either. Use of everything but codes I am competent with. Thanks in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Is this one universal password or each user has own? User enters password into textbox or popup InputBox. If entry matches value in table or hardcoded in procedure, then proceed to open form, else MsgBox saying invalid password.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28
    One universal password to open a form.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    I don't use macros so in VBA, something like:

    If Me.txtPassword = "passwordstring" Then
    DoCmd.OpenForm "formname"
    Else
    MsgBox "Incorrect password. Try again."
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28
    Thanks but I am looking for a way to actually create the ability to use a password in something (form, macro, command, etc) that will open the form. Using the string you provided only works if it is attached to something that asks for a password to begin with.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    A password is an input parameter, it has to come from somewhere, so don't understand what you are wanting.

    I offered VBA code but did not specify what event to put it in. Could be the AfterUpdate of a textbox or a command button Click.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28

    Simply put

    Sorry for the delay.

    Simply put: I have a command button on a form that opens another form. However, I want that second form to be password protected. The button already exists as does the second form. Just need to password protect it. How?

  8. #8
    ansentry's Avatar
    ansentry is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2009
    Location
    Melbourne, Australia
    Posts
    67
    You wrote:
    I have a command button on a form that opens another form.

    I want that second form to be password protected
    Are these the same form?

    If they are then have a look at the attached sample. The password is "password"

    Have a look at the code behind the command button to see how it works.

    If my assumption is wrong post back.

  9. #9
    recon2011 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    28
    John A,

    Thank you. That is exactly what I needed. I appreciate your taking the time to help me. I will mark this solved. Can you also take a look at the thread for "Field Value"? I am trying to do some conditional formatting, I think. Thanks again.

    Marty C

  10. #10
    dichotomous is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    6
    John A. Your code worked for my Database. I now have a password as a gateway between the main database and the HR modal Dialogue. Yipee. Spent a whole darned day looking for this.

  11. #11
    ansentry's Avatar
    ansentry is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2009
    Location
    Melbourne, Australia
    Posts
    67
    Quote Originally Posted by dichotomous View Post
    John A. Your code worked for my Database. I now have a password as a gateway between the main database and the HR modal Dialogue. Yipee. Spent a whole darned day looking for this.
    Glad to help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Password Protect Buttons on Forms
    By Desstro in forum Forms
    Replies: 13
    Last Post: 08-24-2012, 05:04 PM
  2. Upldate password protect linked table
    By snoopy2003 in forum Security
    Replies: 1
    Last Post: 03-18-2011, 12:43 AM
  3. Password Protect Forms
    By jlclark4 in forum Security
    Replies: 3
    Last Post: 01-25-2011, 04:26 PM
  4. readonly password protect
    By mlgehle in forum Security
    Replies: 1
    Last Post: 03-13-2010, 08:59 PM
  5. Password Protect Forms
    By Robert M in forum Programming
    Replies: 3
    Last Post: 01-15-2010, 01:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums