Download Sample 2010 Access File: Login-Register-Reset Password with Security Questions
This sample file is an advanced Login Form that provides a Registration Form for new users and provides a Re-Set Password Form with three security questions when users forgot their password. I personally considered this download file is the most completed Login Form. It also demonstrates how to use a security level to open different form between Admin and User level.
How It Works?
Before reading the description below, please take a look on the flowchart of how this download file works.
Forms and Highlight functions are included in this download file:
#1 Login Form: This form is first loaded when program is opened. It asks user to enter a Login ID and Password. If both Login ID and Password are correct then it will open the Admin form or Main Form depending on the user security level. Two new functions are added into this Login Form.
-New User: This link will open a Registration Form for a new user to register to use this program and complete the security questions.
-Forgot Password: This link will open a Reset Password Form that ask user to enter his/her Login ID and answer all three security questions.
#2 Registration Form: New users will be able to register themselves to use this program by completing their information starting from name, login ID, password and also including the security questions and answers on this form.
a) Duplicated Login ID: This form will not allow a user to register same user Name or LoginID. If a user enters a user Name or LoginID that has already been used in this database a message will pop-up notifying about duplicated Name or LoginID. It tells user to select another Name or LoginID or contacts the administrator.
b) Information Completed: After a new user finishes entering information and clicks on Submit button, this form will ask if user wants to save this information or cancel the registration progress.
- “Yes” to save information, the information will be saved into database and the Registration Form will close and open a Login Form again. The user security level will be automatically assigned to “User.” Now a new user can logon into database with his/her new login ID and password.
- “No” to cancel and go back to the Login Form. The entered information will not be saved in database.
c) Information Incomplete: For a new registration, a new user is required to enter information on all fields. If one of those fields is blank then the message will pop-up after clicking on a Submit button.
d) Undo: a “Cancel” button is provided on this form. Click Cancel to close this form without saving any information and go back to the Login Form.
#3 Reset Password Form: This form will open when a user forgot his/her password and clicks on Forgot Password on the Login Form. It requires user to enter his/her Login ID then hit Enter Key or click on Submit button to bring up the three security questions.
a) Incorrect LoginID: if the LoginID does not match with the LoginID or does not exist in the database a message will display indicating “Invalid LoginID! Please try again.” The security questions will not display.
b) Correct LoginID: Three security questions will display after entering a LoginID that matches with LoginID in the database. The user will need to answer to all three questions correctly in order to reset a password.
c) Not Allow Duplicate Question: There are three security questions that pull from a Question table. When the question is selected for question # 1 then it will not be on the list for question #2. The questions that selected for question #1 & 2 will not be on the list for question #3. So the user will not be able to select same question on the security questions.
d) Incorrect Answers: the security questions will display after entering a correct LoginID; however, the users have five attempts to answer those questions. A message will pop up every time when the answers are incorrect after clicking on a “Reset Password” button. The message also indicates the number of attempt as shown in the picture below.
e) Counter Function: You will learn how to set the counter from this form. If five attempts are reached without a correct answer then a message will pop-up indicating the time out and telling the user to contact the administrator. Every time this form is loaded the counter will be set to 0.
f) Correct Answers: After the user enters all answers correctly and clicks Reset Password button, a message indicates that a temporary password is set to “password” and tell user to login again with a new temp password. After clicking on “OK” button the Reset Password Form will close and go back to Login Form again. Now the user can log in with a new temp password as “password.”
g) Change Password: After a password is re-set to “password”, the user will need to login again on the Login Form with a temp password as “password.” For example below, a user logged in with a loginID “te” and a password as “password.” The program will direct the user to a User Info or Change Password Form to change the password. At this time, the temp “password” is not allowed to save. The user must change to a new password. The user also can change the security questions and answers if he/she wants to.
h) Existing User with No Security Questions Setup: If you implement this Login Form to your existing users in your database, the security questions are not yet answered. If the user logged in with a correct LoginID and Password, but has not yet set up the security questions and answers the user will receive a message notifying his/her security questions have not been set up yet and asking if the user wants to set up now.
If the user answers “Yes” to set up the security questions then the User Info or Reset Password Form will open with a link of his/her information. For instance, the user “test” logged in with correct LoginID and Password. This user will receive a message asking to set up or update the security questions because the security questions and answers are blank. The user also can change the password if he/she wants to. After updating all information and clicking on “Update and Close” button, this form will close and the Main Form will open if the user has a User Security Level or Admin Form will open if has an Admin Security Level.
#4 Main Form: When a user logged in successfully with a regular User Security Level the user will be taken to this form. A form title/caption also will display a user’s name as shown in the picture below “Welcome test to my Database.” This form provides a button “Update Profile” that will open the User Info or Change Password form for user to update his/her information.
#5 User Info or Change Password Form: Users will able to update their information using this form. The developer will learn how to open another form and links a record to the current form by viewing the code under the On Click Event of the “Update Profile” button on Main Form.
#6 Admin Form: This form will open if the user logged in with an Admin Security Level. The admin will be able to update or re-set password for users by clicking on “Re-Set Password for Users” button on this form. The regular users will not be able to see this form.
#7 Re-Set Password by Admin Form: This form will give the ability to Admin to re-set password to ‘password’ for the selected user. The user will need to login with the loginID and password as “password” on the Login Form then change password again. This form should be used only under the Admin Form for the Admin security level.