Reset Forgotten Password Form (1 Viewer)

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
So to help me with not having to do so many admin actions in my database I have created a new user registration form so new people can sign up and start working on their roles in the database.

On my frm_loginform, aside from the username, password, OK button, and Cancel button there are 2 hyperlinks. One is to the frm_registrationform the other is to frm_passchange

I also created a user panel form where users can change their passwords and security questions and answers themselves.

Now I am trying to make the form (frm_passchange) for those who forget their passwords (it happens too often).

tbl_users has:

ID (autonumber)
UserName (short text)
Password (short text)
AccessLvl (number)(values are determined from tbl_accesslevel)
FacilityNumber (short text)(values are determined from tbl_facilities)
EmailAddress (short text)
MachineID (number)
FullName (short text)
Question1 (short text)
Answer1 (short text)
Question2 (short text)
Answer2 (short text)
Question3 (short text)
Answer3 (short text)

I made a new table called tbl_securityquestions with the questions to choose from.
I made a form named frm_passchange with:
*An unbound combobox for them to choose their username from the dropdown with a query (qry_inputusername) as the row source.
Code:
SELECT [tbl_users].[UserName]
FROM tbl_users
ORDER BY [UserName];
*An unbound combobox with a query (qry_securityquestions) for security question 1
Code:
SELECT tbl_securityquestions.Questions, tbl_securityquestions.Questions
FROM tbl_securityquestions
ORDER BY tbl_securityquestions.Questions;
*An unbound testbox for the answer to security question 1
*An unbound combobox with a query (qry_securityquestions) for security question 2
Code:
SELECT tbl_securityquestions.Questions, tbl_securityquestions.Questions
FROM tbl_securityquestions
ORDER BY tbl_securityquestions.Questions;
*An unbound testbox for the answer to security question 2
*An unbound combobox with a query (qry_securityquestions) for security question 3
Code:
SELECT tbl_securityquestions.Questions, tbl_securityquestions.Questions
FROM tbl_securityquestions
ORDER BY tbl_securityquestions.Questions;
*An unbound testbox for the answer to security question 3

So here is the question and plea for help.

I need the code behind this form to make everything happen.

First thing first... once the username is chosen and they choose their saved questions and answers from when they registered... the code needs to verify the username, questions and answers match the values in the fields in the tbl_users.

Then a command button to submit the request and change their password to "password" and redirect them back to the frm_loginform where they can then login with their username and password as their password.

Then the code to look for users with their password as "password" and direct them to their user panel for them to change the temporary password to a different one.

I hope all that made sense.

Is there anyone willing to write some code to help me with this?

I have been searching and reading online for days and nothing really touches on this I can find.
 

isladogs

MVP / VIP
Local time
Today, 02:01
Joined
Jan 14, 2017
Messages
18,221
There are numerous examples of login forms both on this forum & elsewhere.
For example, look at the threads listed at the bottom of this page.
There's also a nice example at Allen Browne's site.

Good luck
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
There are numerous examples of login forms both on this forum & elsewhere.
For example, look at the threads listed at the bottom of this page.
There's also a nice example at Allen Browne's site.

Good luck

Ridders,

Thank you for the information. I have been searching as I said for days and I can find plenty of login forms. I am actually using a modified version of the one that bastanu linked to.

The thing for mine is I do not need to modify my login form... I need a new one that the user can select their username from the combobox and then select their previously set security questions and answers... have it compare the information and if all is good... then set their password to "password" and redirect them back to the logon form.

I already have the modifications done to my login form with a hyperlink to the password reset form. The password reset form is created... just need the correct code for that form only.

Thank you anyway for telling me to read some more.

BTW... the links at the bottom of the page are not the same as what I was asking for help with.
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
Here is an example to get you started:

http://accesshosting.com/create-login-form-ms-access

Cheers,
Vlad

bastanu,

That is a very helpful link and turns out it is where my original logon form code came from with slight modifications.

I cant really determine where in that code the TempPass was set in the tbl_users (my table name) but I will mess around with this for a while and see what I can cobble together.
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
Maybe my search term for forgotten password reset form isn't looking in the right direction because I have a logon form but I want my forgotten password reset form to be seperate.

Most of the forgotten password posts on this site and many others deal with people forgetting their database admin protection password rather than for the front end users of the database
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
There is a really good looking one out there by this guy named tewan but he wants money for it and I am doing this stuff for free so I can't pay for that.
 

bastanu

AWF VIP
Local time
Yesterday, 18:01
Joined
Apr 13, 2010
Messages
1,402
Can you post a sample db with what you have for now (just the login tables and forms) so we could have a look. For the reset form I would simply use a dlookup or dcount once the username and the three security questions have been filled to check if they match the record in the tbl_Users, something like:

Code:
if dlookup("UserName","[tbl_Users]","[Question1]=""" & Me.Question1 & """ AND [Answer1]=""" & Me.Answer1 & """ AND [Question2]=""" & Me.Question2 & """ AND [Answer2]=""" &  Me.Answer2 & """ AND [Question3]=""" & Me.Question3 & """ AND [Answer3]=""" & Me.Answer3 & """")=Me.UserName Then ' do your stuff here like set the password to "password", etc.

Cheers,
Vlad
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
Can you post a sample db with what you have for now (just the login tables and forms) so we could have a look. For the reset form I would simply use a dlookup or dcount once the username and the three security questions have been filled to check if they match the record in the tbl_Users, something like:

Code:
if dlookup("UserName","[tbl_Users]","[Question1]=""" & Me.Question1 & """ AND [Answer1]=""" & Me.Answer1 & """ AND [Question2]=""" & Me.Question2 & """ AND [Answer2]=""" &  Me.Answer2 & """ AND [Question3]=""" & Me.Question3 & """ AND [Answer3]=""" & Me.Answer3 & """")=Me.UserName Then ' do your stuff here like set the password to "password", etc.

Cheers,
Vlad

I have attached a stripped down db. It gives errors when opening because II converted the linked tables to local and removed a bunch of tables, queries and forms etc. but the appropriate forms and tables are there to open manually.

Thank you for your willingness to look at it for me.
 

Attachments

  • Testing - Copy.accdb
    884 KB · Views: 95

bastanu

AWF VIP
Local time
Yesterday, 18:01
Joined
Apr 13, 2010
Messages
1,402
Please have a look now.

Cheers,
Vlad
 

Attachments

  • Testing - Copy_updated.zip
    119.8 KB · Views: 111

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
Please have a look now.

Cheers,
Vlad

That works really good. trying to make a few changes to it. Turns out... it is hard to remember security questions from a dropdown so I am trying to make the username field a textbox and make the security questions show up like a label associated to the data for the current username and them just choose their answers.

Thanks bastanu!
 

bastanu

AWF VIP
Local time
Yesterday, 18:01
Joined
Apr 13, 2010
Messages
1,402
Forgot to mention, the easiest way to show the questions is to use dlookups in the control source of each textbox based on the username -replace the combos with textboxes and use =dlookup("Question1","tbl_users","UserName ='" & [UserName] & "'")

Cheers,
Vlad
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
Forgot to mention, the easiest way to show the questions is to use dlookups in the control source of each textbox based on the username -replace the combos with textboxes and use =dlookup("Question1","tbl_users","UserName ='" & [UserName] & "'")

Cheers,
Vlad

I tried that but nothing displays in the text boxes after I choose a user name
 

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
I take that back... for some reason it does work in the stripped down database but not in the full one. I will have to figure out why
 

bastanu

AWF VIP
Local time
Yesterday, 18:01
Joined
Apr 13, 2010
Messages
1,402
Here you go.

Cheers,
Vlad
 

Attachments

  • Testing - Copy_updated.zip
    119.9 KB · Views: 119

psyc0tic1

Access Moron
Local time
Yesterday, 20:01
Joined
Jul 10, 2017
Messages
360
Vlad... you are awesome. I was able to get all of the features working after your help.

Thank you very much for everything.
 

bastanu

AWF VIP
Local time
Yesterday, 18:01
Joined
Apr 13, 2010
Messages
1,402
You're welcome, good luck with your project!

Vlad
 

Users who are viewing this thread

Top Bottom