UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Forcing Password Change On First Login    
 
   
MrsNLynah
post Aug 3 2017, 07:44 PM
Post#1



Posts: 1
Joined: 27-July 17



I am creating a database, I am also a newbie. I have created a login form and it does work. What I want to happen is for the End User to be prompted to change their password when they logon for the first time.
Here is the code that I am using that works well.

Private Sub btnlogin_Click()
Dim rs As Recordset

Set rs = CurrentDb.OpenRecordset("tblUser", dbOpenSnapshot, dbReadOnly)

rs.FindFirst "UserName='" & Me.txtUserName & "'"

If rs.NoMatch = True Then
Me.lblWrongUser.Visible = True
Me.txtUserName.SetFocus
Exit Sub
End If
Me.lblWrongUser.Visible = False

If rs!Password <> Me.txtPassword Then
Me.lblWrongPass.Visible = True
Me.txtPassword.SetFocus
Exit Sub
End If
Me.lblWrongPass.Visible = False
DoCmd.OpenForm "Frm_Main_Menu"
DoCmd.Close acForm, Me.Name

End Sub

Thank you in advance for your help!!
Go to the top of the page
 
theDBguy
post Aug 3 2017, 08:21 PM
Post#2


Access Wiki and Forums Moderator
Posts: 71,230
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Welcome to UtterAccess!
welcome2UA.gif

This looks like an Access project, so I have moved your question from the Web Development forum.

To check if this is the first time the user logged on, you'll probably need a field as a flag. You can then check this field if they have logged on before or not.

Just a thought...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
pere_de_chipstic...
post Aug 4 2017, 04:23 AM
Post#3


UtterAccess Editor
Posts: 10,112
Joined: 8-November 07
From: South coast, England


welcome2UA.gif

The system I've used is to provide a default password when the user is added to the system, this is the same as their userID. The system checks to see if the logon password is the same as their ID and if so opens a change password pop up form.

hth

--------------------
Warm regards
Bernie
Go to the top of the page
 
ScottGem
post Aug 4 2017, 06:37 AM
Post#4


UtterAccess VIP / UA Clown
Posts: 32,183
Joined: 21-January 04
From: LI, NY


You might find this Wiki http://www.UtterAccess.com/wiki/Login_Security helpful. I use a PWReset flag in my users table. If the flag is set to True, then it forces the user to enter a new password.

--------------------
Scott <>
Scottgem's Blog
Microsoft Access MVP since 2007
Author: Microsoft Office Access 2007 VBA
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 07:45 AM