Solved Changing user's password (1 Viewer)

Amako

New member
Local time
Today, 01:02
Joined
Jul 5, 2020
Messages
8
Hello everyone.
I made a really simple database for our association. To log in it have a login form. The users ask to have the ability to change their password and and I can't do it despite all the research I do. I am new to vba and everything I find on it seem really complicate to me. Having the login form code was not easy.
Thanks to everyone who can help me with the attached file.
 

Attachments

  • Database1.zip
    30.4 KB · Views: 101

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:02
Joined
May 7, 2009
Messages
19,169
here test this.
 

Attachments

  • Database1.zip
    59.9 KB · Views: 112

Amako

New member
Local time
Today, 01:02
Joined
Jul 5, 2020
Messages
8
Thanks very much arnelgp. It's working far beyond my expectations.
A last thing. I think it would be good to force them to change their password on the first connection. Sorry I should have said it on the first post.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:02
Joined
May 7, 2009
Messages
19,169
ok, goodluck chum!
 

Amako

New member
Local time
Today, 01:02
Joined
Jul 5, 2020
Messages
8
OK isladogs, I'm going to take a look at your example
 

Amako

New member
Local time
Today, 01:02
Joined
Jul 5, 2020
Messages
8
I read the page and I think that your example is a very high level considering my project and I wonder if I can just extract the part to force the user to change his password. But I'm going to try.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:02
Joined
May 7, 2009
Messages
19,169
added 3 fields to User table:

LastPasswordChange
DaysAfterChange
ForceChangePass

DaysAfterChange was adjusted 1 month before (1 month before Today).
see change in code in form Login.
 

Attachments

  • Database1.zip
    63.4 KB · Views: 121

isladogs

MVP / VIP
Local time
Today, 00:02
Joined
Jan 14, 2017
Messages
18,186
I read the page and I think that your example is a very high level considering my project and I wonder if I can just extract the part to force the user to change his password. But I'm going to try.

If arnel's code does what you want, you may not need to do so but it would be useful to do so even if just as a learning exercise.

Anyway, that was my intention when I suggested you look at it.
In the example app, when a new user is added their password is stored as 'Not Set' (but encrypted).
When the user tries to login, the code checks if that is still the saved password and, if so, forces the user to change it before log in is allowed.
In other words this happens the first time they login.

BTW I strongly recommend that passwords are encrypted for security and data protection
 

Amako

New member
Local time
Today, 01:02
Joined
Jul 5, 2020
Messages
8
If arnel's code does what you want, you may not need to do so but it would be useful to do so even if just as a learning exercise.

Anyway, that was my intention when I suggested you look at it.
In the example app, when a new user is added their password is stored as 'Not Set' (but encrypted).
When the user tries to login, the code checks if that is still the saved password and, if so, forces the user to change it before log in is allowed.
In other words this happens the first time they login.

BTW I strongly recommend that passwords are encrypted for security and data protection

Your example is very great and you explain it very well there. I keep it for when I will try to make a more complex application (witch I think will be soon) or for an eventual friend in need. Also I see a bunch of good things there. Thank you.
 

Amako

New member
Local time
Today, 01:02
Joined
Jul 5, 2020
Messages
8
added 3 fields to User table:

LastPasswordChange
DaysAfterChange
ForceChangePass

DaysAfterChange was adjusted 1 month before (1 month before Today).
see change in code in form Login.
Thank you arnelgp, with that the application is ready.
 

Users who are viewing this thread

Top Bottom