Hi everyone,
I am doing a small exercise within my DB to initiate user logins and reset password forms.
I have following code in password reset form but its not a correct one but some how i able to reach half way.
This exercise to reset users login detail if in case they forgot the password.
I have three buttons (BtnSubmitLoginID, BtnCancel, BtnResetPassword)
Step 1: I want if LoginID text box is blank then following message asking to enter the correct LoginID should appear.
Step 2 : Next is once loginID is filled with data it should check tblUsers for this user's LoginID if found then remaining next two fields (txtEmpID & txtPrevillage) should appear on the form, otherwise it should ask to enter correct loginID.
Step 3: After this user's next step should be filling the information in txtEmpID and txtPrevillage if its goes wrong the same message should appear asking to enter correct details, otherwise the 3 security questions combobox (cboQuestion1, cboQuestion2, cboQuestion3) should should appear/filled with user's saved questions in tbluser.
Step 4: After above if answers where given wrongly for 3 attempts then it should not further allow user to Reset password manual and give message to contact the Administrator, if answered correctly while attempting three times for all answers than he could be able to reset the necessary questions and all the other details with reset Button.
I can feel it could be extensive coding but your generous help will be appreciated.
I am doing a small exercise within my DB to initiate user logins and reset password forms.
I have following code in password reset form but its not a correct one but some how i able to reach half way.
This exercise to reset users login detail if in case they forgot the password.
I have three buttons (BtnSubmitLoginID, BtnCancel, BtnResetPassword)
Step 1: I want if LoginID text box is blank then following message asking to enter the correct LoginID should appear.
Step 2 : Next is once loginID is filled with data it should check tblUsers for this user's LoginID if found then remaining next two fields (txtEmpID & txtPrevillage) should appear on the form, otherwise it should ask to enter correct loginID.
Step 3: After this user's next step should be filling the information in txtEmpID and txtPrevillage if its goes wrong the same message should appear asking to enter correct details, otherwise the 3 security questions combobox (cboQuestion1, cboQuestion2, cboQuestion3) should should appear/filled with user's saved questions in tbluser.
Step 4: After above if answers where given wrongly for 3 attempts then it should not further allow user to Reset password manual and give message to contact the Administrator, if answered correctly while attempting three times for all answers than he could be able to reset the necessary questions and all the other details with reset Button.
Code:
Option Compare Database
Private Sub BtnCancel_click()
Me.Undo
DoCmd.Close
End Sub
Private Sub BtnResetPassword_Click()
End Sub
Private Sub BtnSubmitLoginID_Click()
On Error GoTo errhandlers:
If IsNull(LoginID) Then
MsgBox "You have not entered Login ID", , "No info"
ElseIf IsNull(txtEmpID) Or IsNull(txtPrevillage) Or IsNull(txtAnswer1) Or IsNull(txtAnswer2) Or IsNull(txtAnswer3) Then
MsgBox "Employee ID, Previllage & All Answer fields are required !", , "Required fields"
Else
msg = "Do you want to submit your information"
Style = vbYesNo + vbCritical
Title = "Registration Confirmed"
response = MsgBox(msg, Style, Title)
If response = vbYes Then
DoCmd.Close
Exit Sub
End If
If response = vbNo Then
Me.Undo
DoCmd.Close
Exit Sub
End If
End If
exit_errhandlers:
Exit Sub
errhandlers:
MsgBox Err.Description, vbCritical
Err.Clear
Exit Sub
End Sub
I can feel it could be extensive coding but your generous help will be appreciated.