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

    Creating a Form holding details from a users login

    I was wondering if anyone could help me with the following problem I need to fix.

    In my database, I have a table which holds the details of members (names, username, password etc) and another table to store their responses to a series of statements I wish for them to answer (numerical raking system)

    In order to gain access to the form to input their responses, they must correctly enter their details into a username and password form. The code for identify and verify access is located below:

    Private Sub btnSearch_Click()
    Dim sUser As String
    Dim sPassword As String
    sUser = Me.txtUserName
    sPassword = Me.txtPassword


    If DCount("*", "T_User_Details", "Username = " & sUserID & " And Password = '" & sPassword & "'") = 0 Then
    MsgBox "Incorrect User Details! Please re-enter your details", vbExclamation, ""
    Else
    DoCmd.OpenForm "F_User_Details"
    End If
    End Sub


    However, I want the userís details to appear on the response form so that they do not need to enter their names etc, just simply input their numerical ranking to each of the statements.


    Can anyone help me with this as it is driving me mad?

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    If the user enters the correct UserName/Password combination, they will be directed to the 'F_User_Details' Form?

    Is your 'F_User_Details' Form based on your 'Response' Table?

    If so, does the 'Response' Table have a UserName - or UserID field with which it can be connected to the data on your UserName-Password Form?

    I'm just trying to connect the dots so I can understand exactly what you need to achieve.

    Any details you can give me might help.

  3. #3
    macftm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    I'm not too sure what a response table is Robeen. I created the form using the wizard based in table information.

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You have two Forms - right?
    One of them is the Log In form?
    The other Form is 'F_User_Details'?

    I just called the Table behind the 'F_User_Details' Form - 'Response' because you didn't mention the table name in your first post - and I understood that on the 'F_User_Details' Form the user would be filling in some 'Responses'?

    Give me the actual names of your two Forms and tell me the names of the Table that each Form is based on.

    What are the main field names in your two Tables?

    Then - tell me what you need to do after a User has successfully Logged In.

  5. #5
    macftm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    Yes I have two form.

    Form 1 (F_User_Search) - User Login - unbounded text boxes which required the users username and password

    Form 2 (Navigation Form1)- This is the response form related to the tables:
    i)'T_User_Information which holds the details of each user e.g. user name, name and password)
    ii) T_PSE_T1 which holds the statement response fields which the user will populate.

    Once they users details have been verified in by the following code: (so slight changes to the code above)

    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

    I want the users details to be specific to that user e.g. Name and Department. From there, they can populate the table T_PSE_T1 by ranking the responses on the form.

    However, at the moment, regardless of who's user details I enter into the search form (F_User_Search) it is coming up with the same user's details.

    The two tables are liked by the fields UserName

    Thank for your time and patients
    Macftm

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    1.
    Is this:
    However, I want the userís details to appear on the response form so that they do not need to enter their names etc, just simply input their numerical ranking to each of the statements.
    . . . still the goal of this thread?

    2.
    Does "Navigation Form1" replace "F_User_Details"? Are they the same Form that you renamed?

    3.
    Does the UserName, Name and Department already exist in Table "T_PSE_T1"?

    I will need all three questions above answered in order to help you.

  7. #7
    macftm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    Point 1 - Yes this is the case - the user details related to their first and surname and department should appear automatically on the Navigation Form1.

    Point 2 - Yes, Navigation Form1 is the form that should open once the users details have been verified.

    Point 3 - UserName, First Name, Surname and Department all already exists in the table T_User_Information.

    UserName links the two tables (primary key T_User_Information and foreign key in table T_PSE_T1

    Thank you for your patience and sorry i'm unclear. I am new that VBA and must appreciate your time.

    Regards

    Macftm

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

Similar Threads

  1. Login form with nt login
    By hitesh_asrani_j in forum Forms
    Replies: 6
    Last Post: 09-22-2011, 11:43 AM
  2. Replies: 7
    Last Post: 06-24-2011, 10:42 PM
  3. Trouble With Variable holding Value
    By michaelb in forum Programming
    Replies: 3
    Last Post: 02-25-2011, 11:32 AM
  4. Form Not Holding Data
    By batowl in forum Forms
    Replies: 24
    Last Post: 02-18-2011, 12:08 PM
  5. Replies: 1
    Last Post: 01-04-2008, 11:40 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