Results 1 to 14 of 14
  1. #1
    Chekotah is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2014
    Posts
    32

    Changing password after initial login

    Ok. I am sure that there are tons for this request. I am trying tor force that once you log on to the data base initially that you have to change the password. I currently have a table that has a generic password but want them to change it after the initial log on as I am sure that many will not want to change their password if they don't have to. I have created a change password form so they will be able to change their password any time.

    Here is the code currently which is working other than not changing the password.

    Private Sub Login_Click()
    On Error GoTo Err_Login_Click


    Dim varEvent As Variant
    Dim stDocName As String

    varEvent = DLookup("[UserType]", "[ID_PW_Check]")

    If Not IsNull(varEvent) Then

    stDocName = "Switchboard" & varEvent
    DoCmd.Close acForm, "Login", acSaveNo
    DoCmd.OpenForm stDocName

    Else
    MsgBox "User name not found or password is incorrect", vbInformation, "Warning"
    End If

    Exit_Login_Click:
    Exit Sub

    Err_Login_Click:
    MsgBox Err.Description
    Resume Exit_Login_Click

    End Sub


  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I don't see anything in that code that would change a password, nor is there anything that opens a form to change it.

    Where is the password supposed to be changed?

    Your DLookup doesn't look right - all it will do is return the value of UserType in the "first" record of ID_PW_Check, and it will be the same record each time - you don't have a criteria specification.

    John

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Also, I would consider a Boolean to indicate whether or not the password has been reset (temp pass) by Admin.

  4. #4
    Chekotah is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2014
    Posts
    32
    That is what I am trying to do is get it to open the change password form in order to change the password after they initially log into the dB.

    they sign in to using their employee id. the Dlook up verifies that that they are on the table and then a switchboard will then open up based off their User type (admin or user). If their employee id is not on that table the error message pops up saing User name not found.

  5. #5
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    They sign in using their employee_id, but the dLookup does not indicate which Employee_ID it is to look for in the ID_PW_Check table/query.

    The DLookup must contain a criteria parameter to indicate which employee record to look for, e.g:

    DLookup("[UserType]", "[ID_PW_Check]","Employee_ID = " & me!Login_ID) if The Employee_ID is numeric,
    or
    DLookup("[UserType]", "[ID_PW_Check]","Employee_ID = '" & me!Login_ID & "'") if The Employee_ID is a text string

    Now, if varevent is not null, what is there to indicate that this is the first login?

    This routine does not validate the password anywhere, either - that is something it must do, otherwise what is the point of entering one?

    Using English, the sequence of events would be something like this:

    1. Employee enters user_id & password
    2. If the User_ID is not valid, give error message and exit
    3. If the password is not valid, give error message and exit
    4. If the password is valid but is the initial value, open the form to change it
    5. Determine the User type, and open the appropriate form

    HTH

    John

  6. #6
    Chekotah is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2014
    Posts
    32
    Thanks John however when I changed the dlook up to the one above I am getting an error message below


    " Microsoft Office Acces can't find the field 'Login_ID' referred to in your expression."

  7. #7
    Chekotah is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2014
    Posts
    32
    Ok never mind on my last message. i now have it fixed. However, I still need some help on getting it to change password after their initial login.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What have you tried so far?

  9. #9
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You will need a procedure, perhaps in a separate form, that asks the user to enter a new password, validates it, and then updates the user table.

    John

  10. #10
    ldl is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    3
    Quote Originally Posted by John_G View Post
    You will need a procedure, perhaps in a separate form, that asks the user to enter a new password, validates it, and then updates the user table.

    John
    First, let me say hello to all. I am not an Access expert, but I have accomplished what you are inquiring about. Please see attached and hope it helps. You will have to edit the code to get the password checking form to run. The concept is very basic and should be easy to adapt in your application.

    LDL
    Attached Files Attached Files

  11. #11
    casinc815 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2013
    Location
    Chicago, IL
    Posts
    46
    IDl:

    I downloaded your suggested app and it worked well!

    I was wondering if you have a login routine you could share with us/me?
    I need a login routine for my app and am running out of time. I can be
    reached at casinc815@hotmail.com to discuss, if interested!

    Thanks!

    Jim

  12. #12
    ldl is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    3
    Quote Originally Posted by casinc815 View Post
    IDl:

    I downloaded your suggested app and it worked well!

    I was wondering if you have a login routine you could share with us/me?
    I need a login routine for my app and am running out of time. I can be
    reached at casinc815@hotmail.com to discuss, if interested!

    Thanks!

    Jim
    Jim
    See attached zip. Working model attached with login routine and password checking/change. Good Luck.
    Attached Files Attached Files

  13. #13
    casinc815 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2013
    Location
    Chicago, IL
    Posts
    46
    IDL

    Thanks for the help. I had my procedure done in three hours and used two of
    your forms. After modifying to fit my project, everything appears to be working
    well! So, thank you very much!

    Jim

  14. #14
    ldl is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    3
    Quote Originally Posted by casinc815 View Post
    IDL

    Thanks for the help. I had my procedure done in three hours and used two of
    your forms. After modifying to fit my project, everything appears to be working
    well! So, thank you very much!

    Jim
    Your Welcome. Glad I was able to help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. After Password Login Form
    By data808 in forum Access
    Replies: 13
    Last Post: 02-25-2014, 12:46 AM
  2. Password Login Forms
    By data808 in forum Access
    Replies: 1
    Last Post: 02-20-2014, 11:41 AM
  3. Login Form with Password
    By data808 in forum Programming
    Replies: 1
    Last Post: 02-12-2014, 01:06 PM
  4. Password ### login
    By buckwheat in forum Access
    Replies: 5
    Last Post: 09-10-2013, 11:54 AM
  5. Login/Password Code not working
    By eww in forum Programming
    Replies: 3
    Last Post: 09-21-2010, 10:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums