Results 1 to 3 of 3

Thread: How do i make my access query work in vb and access?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    Hi, I have a query in access that i amd trying to run in VB5 but have a problem. My problem is: The query I have written needs a parameter or something. The code I have entered is a sql query:

    SELECT * FROM Clients WHERE Clients.AccountID = Results.AccountID
    ORDER BY Surname;

    It comes up with a question mark on Results.AccountID but the relationship is one is to many (1 from Clients.AccountID)
    Now what I want the query to do is where Clients.AccountID = primary key in Clients table and Results.AccountID = Foriegn Key in Results table, I want it to equal the same value so that when i run a different query these 2 fields are exactly the same. Is there some way to get it to equal each other.
    and get a parameter to work.?????
    Any help would be appreciated and thanx in advance for an help.

  2. #2
    Guest

    Post

    You need to also open the results table like this:
    SELECT * FROM Clients,RESULTS WHERE Clients.AccountID = Results.AccountID
    ORDER BY Surname


    Hope it helps
    -Azzmodan

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    Yeah thanx Azzmodan for the help. That solved it.

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