Results 1 to 4 of 4
  1. #1
    Luke.F.14 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    3

    Change password form in login system

    Hi,



    I have created a login system as part of my A-Level database. Part of the script i have used makes a user change their password if it is the default "password", i.e. if they are new or their password has been reset by the admin user using an update query. The script puts up a message box saying "Please change password" which then opens a change password form. The problem lies here. If i leave it as so, there is nothing stopping the user from navigating through and changing other user's passwords, considering the change password form is based upon the table of users/passwords. Basically, i need a way of filling the change password form with the data of the username that has been inputted in the login section, and then disabling navigation so that they can only change their own password - for example, a "user1" puts their username, user1, and password, password, into the login form and presses enter. It then prompts user1 that their password needs changing, then the change password form pops up. This change password form is just a form based upon the table of users - user1 would need to navigate through and find his own details or he could in effect change any other users details - this is what i want to stop, so that user1's details automatically populate the change password form and navigation to other records is disabled.

    Many thanks
    Luke

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    My inclination is to ask 'why bother with passwords'?
    If you have a user table which contains their Windows Login ID (NOT their Windows password), when they try to open the db, use fosUserName() (search for this simple function) and to keep it simple, DLookup the table for that value. If it isn't found, they don't get in.

    If you're really so into passwords, then don't show them all the table values. Your form must have a user name field, no? Restrict the view to the password record for that user and don't have navigation controls on the form. Base the form on an updatable query, not the table, and filter the query via the login form user name. I stopped using login passwords long ago and nobody could get in if they weren't in the table. Of course, I had to make sure they couldn't access the tables, but that's another topic.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In addition to Micron's suggestion, I like to restrict access to different portions of the db. This can be done through permissions. The attached is a rather lengthy thread but once in place is very effective.

    https://www.mrexcel.com/forum/micros...ns-system.html

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    I use Active Directory in combination with a Custom Users table that contains user groups for limiting access.

    But to your question above, when they put in their ID and password of "Password" for the reset, pop up an unbound form that only has 1 textbox field for the new password along with a Submit button. Once they put in new password and hit submit, use code to update their specific record with the new password, close that pop up form and pull up the main form. That way they only change their info. You could also put in a msgbox saying "Your password has been updated.".

    dbs.Execute "UPDATE YourUserTable SET EmpPassword = '" & me.NewPassword & "' WHERE UserID = '" & Me.UserID & "';"

    Not sure that syntax is all correct but you get the idea.

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

Similar Threads

  1. Replies: 4
    Last Post: 03-28-2017, 03:10 PM
  2. password login form with tags?
    By vicsaccess in forum Programming
    Replies: 6
    Last Post: 03-16-2016, 06:17 PM
  3. After Password Login Form
    By data808 in forum Access
    Replies: 13
    Last Post: 02-25-2014, 12:46 AM
  4. Login Form with Password
    By data808 in forum Programming
    Replies: 1
    Last Post: 02-12-2014, 01:06 PM
  5. Replies: 1
    Last Post: 06-22-2012, 08:05 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