LogIn and display Related items from a second table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swaggerking
    New Member
    • Feb 2007
    • 2

    LogIn and display Related items from a second table

    First off, I'm using Dreamweaver and an Access db. Second, I'm a novice.

    I have two tables in my db: "tdClients" & "tdClientInvoic es". The only relation/common denominator in each table is the field "ClientID". Once I log in I want display info from the both tables dependent on matching ClientID.

    My table layout:
    _tdClients
    uid (autonumber)
    ClientID (text)
    UserName
    PassWord
    FName
    LName

    _tdClientInvoic es
    uid
    ClientID (text)
    Invoice
    InvoiceDate
    Comments

    How do I login and also display the clients invoices based upon ClientID?
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    You need to set a db connection, then open the connection with this query statement:
    Code:
    SELECT * FROM tdClientInvoices, tdClients WHERE tdClientInvoices.ClientID=tdClients.ClientID
    Are you looking for the code for setting the connection too?

    Comment

    • swaggerking
      New Member
      • Feb 2007
      • 2

      #3
      Thank you. You really helped me and it seems to working.

      SELECT *
      FROM Clients, Invoice
      WHERE UserName = 'MMColParam' AND Clients.Custome rID=Invoice.Cus tomerID

      Comment

      Working...