Results 1 to 2 of 2
  1. #1
    tsgtnissen is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    28

    Question Need help with a form password(small tweak)


    So.. This code is working and the form works great, but I would like to add a small extra feature. I currently have to manually go in and set the "password" in the code. I would like to make a simple form that will have the "password" in a text box/listbox or whatever so the admin could change the password without having to go into the code. I'm very weak at coding but my guess was something like this.

    If PassWord = "gpc" Then--------old
    If PassWord = "[passwordtable].[password]" Then-----would this work?

    Code:
    Private Sub Form_Load()
    Dim PassWord As String
       PassWord = InputBox("Enter Password to gain full access or click OK to view this GPC account with limited rights.")
       If PassWord = "gpc" Then
          ' Open Form
          Me.Date_Requested.Locked = False
          Me.AO.Locked = False
          Me.Paid.Locked = False
          Me.Vendor.Locked = False
          Me.Description.Locked = False
          Me.Debit.Locked = False
          Me.Requestor.Locked = False
          Me.Status.Locked = False
          Me.Reconciled.Locked = False
          Me.Basic_Amount.Locked = False
          Me.Catagory.Locked = False
           cmdNewTask.Visible = True
           Command139.Visible = True
           Me.Reconciled_Date.Locked = False
    

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,628
    Bind a form to passwordtable. Admin can type whatever they want into textbox bound to password field to change password.

    Then code options to validate password:

    1. If there is a login form with a textbox for password, bind login form to the password table:
    If tbxPassword = Me!password Then

    2. Otherwise:
    If Password = DLookup("password", "passwordtable") Then
    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.

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

Similar Threads

  1. Query tweak
    By BRZ-Ryan in forum Queries
    Replies: 5
    Last Post: 01-24-2014, 04:06 PM
  2. Replies: 2
    Last Post: 12-24-2012, 10:15 PM
  3. Query tweak to get singles - newb
    By bentod in forum Queries
    Replies: 7
    Last Post: 10-11-2012, 11:41 AM
  4. Replies: 1
    Last Post: 06-22-2012, 08:05 AM
  5. Help with small form calculations
    By Nokia N93 in forum Access
    Replies: 3
    Last Post: 12-06-2011, 06:29 AM

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