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    
post Aug 3 2017, 07:44 PM

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
Exit Sub
End If
Me.lblWrongUser.Visible = False

If rs!Password <> Me.txtPassword Then
Me.lblWrongPass.Visible = True
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
post Aug 3 2017, 08:21 PM

Access Wiki and Forums Moderator
Posts: 73,936
Joined: 19-June 07
From: SunnySandyEggo


Welcome to UtterAccess!

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...
Go to the top of the page
post Aug 4 2017, 04:23 AM

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


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.

Go to the top of the page
post Aug 4 2017, 06:37 AM

UtterAccess VIP / UA Clown
Posts: 32,213
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.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    13th December 2018 - 08:07 AM