Results 1 to 3 of 3

Thread: get all information from a username

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    1

    get all information from a username

    hi, I am stuck at the point where it will just return whatever information is inside the excel database instead of the ones that relate to the username only.

    Excel database
    tblLogin
    PK_LoginID-autonum (primkey)
    Username-text
    Password-text

    tblTasks
    PK_TasksID-autonum
    FK_TasksID-num
    Date-text
    Tasks-text

    for my vb application, I set the main form to hide itself and display the login form, once the user log on with the correct username and password, I only need the main form to display information about the username that logged on.

    this is my sql statement I used
    rstLogin.Open "SELECT * FROM tblLogin, tblTasks, tblMemo WHERE tblLogin.PK_LoginID = tblTasks.FK_TasksID;"...

    any idea on how I can solve this problem? thanks for your time.

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: get all information from a username

    Once the user has logged in successfully store their ID then run your SQL query.

    VB Code:
    1. "SELECT * FROM tblLogin, tblTasks, tblMemo WHERE USERID = '" & ID & "'"

  3. #3
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: get all information from a username

    Your recordset should be like this :

    rstLogin.Open "SELECT tblLogin.*, tblMemo.*, tblTasks.*
    FROM (tblLogin INNER JOIN tblMemo ON tblLogin.PK_LoginID = tblMemo.FK_TasksID) INNER JOIN tblTasks ON tblLogin.PK_LoginID = tblTasks.FK_TasksID WHERE tblLogin.Username= '" & YourUsernameTextBox.Text & "'"

    You wanted to link FK_TasksID with tblMemo, right?

    Hope this help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width