Results 1 to 2 of 2
  1. #1
    nishant.dhruve is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    34

    Prompt user during first login

    I want to Prompt user to create a new password after their first login. Also it should be capable of looking by default password. for example. in table if password is "password" that it should prompt user to create a new password i, other than that no require to change password
    How can i do that?
    Here is the code what i m using for user to login
    [/code]
    Private Sub cmdlogin_Click()
    Dim rs As Recordset

    Set rs = CurrentDb.OpenRecordset("Query1", dbOpenSnapshot, dbReadOnly)
    rs.FindFirst "username = '" & Me.txtusername & "'"

    If rs.NoMatch = True Then
    Me.lblwrongusername.Visible = True
    Me.txtusername.SetFocus
    Exit Sub

    End If


    Me.lblwrongusername.Visible = False

    TempVars("username").Value = Me.txtusername.Value

    If rs!Password <> Encrypt(Me.txtpassword) Then
    Me.lblwrongpassword.Visible = True
    Me.txtpassword.SetFocus
    Exit Sub
    End If

    Me.lblwrongpassword.Visible = False

    TempVars("username").Value = Me.txtusername.Value


    If rs![Acess type] = 1 Then

    DoCmd.OpenForm "frmhomeadmin"
    'DoCmd.close acForm, Me.Name
    Me.Visible = False
    [/code]

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    Let's assume that query1 is based on a table, tblUsers.
    Add a field to tblUsers named LastLoginDate. If that date is null, then the user has not yet logged in the first time. After each successful login, code will update LastLoginDate with today's date. That bit of data may also become useful at some time in the future.
    If you want to avoid dangerous passwords like "password", 12345, "just me" or the like, you can create a new table containing such phrases and check all password change attempts against the table and refuse them if a match is found.
    Last edited by davegri; 12-27-2016 at 04:49 PM. Reason: more words

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

Similar Threads

  1. Pop Up window to prompt user!
    By Kevo in forum Forms
    Replies: 6
    Last Post: 06-14-2012, 02:25 PM
  2. Replies: 1
    Last Post: 02-01-2012, 11:27 PM
  3. User Prompt for multiple Files
    By ratherbgolfing in forum Programming
    Replies: 1
    Last Post: 01-31-2012, 03:38 PM
  4. Prompt User for Date Range when running QUERY
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 01-30-2012, 11:49 AM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 PM

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