Results 1 to 2 of 2
  1. #1
    macftm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21

    Create a Form which Displays User Details from Login form

    Hi,
    I am creating a database which will allow users to enter a numerical response to a series of statements.



    This form will have the users name and department located on it automatically once the user has logged in.
    I have create a table containing the user details e.g. username, password, name and department.

    I have another table which will hold the returned values for each statement the user must rank.

    In addition to this, I have a user verification form, which check the user's username and password correctly, and will only open the response form once their details have been verified. The code form this is shown below:

    Private Sub btn_Search_Click()
    Dim sUser As String
    Dim sPassword As String

    sUser = Me.txtUserName
    sPassword = Me.txtPassword

    If DCount("*", "T_User_Information", "UserName = '" & sUser & "' And Password = '" & sPassword & "'") = 0 Then
    MsgBox "Incorrect User Details! Please re-enter your username and password", vbExclamation, ""
    Else
    DoCmd.OpenForm "Navigation Form1"
    End If
    End Sub


    The problem I am having at the moment is that once a user has been verified, the form brings back the details for the user, regardless of the user’s details which have been entered.

    Can anyone help suggest a way I can get the response form to link up with each user?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You can either use this technique to restrict the records:

    http://www.baldyweb.com/wherecondition.htm

    Or base the form on a query with the appropriate criteria.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. HELP>Access 2010 User Login Form Code.
    By zaaimanm in forum Programming
    Replies: 5
    Last Post: 10-22-2012, 07:28 PM
  2. Replies: 6
    Last Post: 12-12-2011, 01:28 PM
  3. Replies: 3
    Last Post: 09-22-2011, 03:35 PM
  4. Replies: 2
    Last Post: 12-08-2010, 01:32 PM
  5. Form displays ID number, not data
    By Twimm in forum Forms
    Replies: 5
    Last Post: 07-13-2010, 03:04 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