Results 1 to 2 of 2
  1. #1
    harpreett.singhh@gmail.co is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    25

    Setup Login Form

    Hi All,



    I have adopted a code for my startup login form of my database made in Access 2010.

    When I run the form with below said code. insert username and password It does not accepts password. I have tried changing password and carefully put up again. but not accepting the password. what I am missing ? Please advise.

    Private Sub Cmd_Login_Click()


    Dim dbs As Database
    Dim rstuserpwd As Recordset
    Dim bfoundmatch As Boolean


    Set dbs = CurrentDb


    Set rstuserpwd = dbs.OpenRecordset("qryuserpwd")
    bfoundmatch = False


    If rstuserpwd.RecordCount > 0 Then
    rstuserpwd.MoveFirst


    'check for matching records
    Do While rstuserpwd.EOF = False


    If rstuserpwd![UserName] = Form_FrmLogin.TxtUserName.Value And rstuserpwd![Password] = Form_FrmLogin.TxtPassword.Value Then
    bfoundmatch = True
    Exit Do
    End If
    rstuserpwd.MoveNext
    Loop
    End If


    If bfoundmatch = True Then


    'open the next form here and close this one


    DoCmd.Close acForm, Me.Name
    DoCmd.OpenForm "Main Audit Form"


    Else
    '
    MsgBox "Incorrect Password. Please Try Again"
    End If


    rstuserpwd.Close


    End Sub

  2. #2
    robrich22's Avatar
    robrich22 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    Louisville, KY
    Posts
    41
    I just finished helping another user with the same problem. Check out this post, for code on how to handle a login form. Reply to the thread over there, and I'll set you up with some specific code.

    https://www.accessforums.net/access/...13/index2.html

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

Similar Threads

  1. Form Setup Help
    By kgbo in forum Forms
    Replies: 1
    Last Post: 08-14-2013, 03:28 PM
  2. Help or Guide to Particular Form Setup
    By Zephyx in forum Forms
    Replies: 2
    Last Post: 06-27-2013, 03:53 PM
  3. MS Access Form/Query Setup
    By Datatech in forum Database Design
    Replies: 5
    Last Post: 05-31-2012, 12:08 AM
  4. Login form with nt login
    By hitesh_asrani_j in forum Forms
    Replies: 6
    Last Post: 09-22-2011, 11:43 AM
  5. Replies: 1
    Last Post: 08-19-2011, 02:53 PM

Tags for this Thread

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