Results 1 to 9 of 9
  1. #1
    allstar45 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    35

    Multi-query display dilema

    Hello,

    I am creating a DB with a table called "References", which is joined to multiple other tables; let's call them tbl1, tbl2, tbl3, tbl4 and tbl5, tbl6.

    I have 6 queries that, when ran, ask for a reference name, and output 1 field "name" with everything that is joined to that reference.

    What I want, is to allow the user to look at all the things that one reference is joined to.

    SO! what I did was make a form with 5 subforms, displaying the 6 queries that I made.
    This is fine, exept now the user has to enter in the reference name 6 times.

    Any ideas / alternate methods?

    I am in school for programming, and know my way around SQL queries.

    PS: I also have made a query that shows everything I want, with only 1 prompt, which looks like this:

    SELECT qryRefIDtoTP1Name.name AS [cool],
    qryRefIDtoTP2Name.name AS [cooler],


    qryRefIDtoTP3Name.name AS [coolest],
    qryRefIDtoTP4Name.name AS [massive cool],
    qryRefIDtoTP5.question AS [Question cool],
    qryRefIDtoTP6Name.name AS [cooling point]
    FROM qryRefIDtoTP1Name, qryRefIDtoTP2Name, qryRefIDtoTP3Name, qryRefIDtoTP4Name, qryRefIDtoTP5, qryRefIDtoTP6Name;

    but the results are every combination of all of the rows in each query result.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    When you have no joins between the source tables/queries, you get a Cartesian product.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    allstar45 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    35
    Thanks for the reply,

    I have nothing to join the query results ON. Is it possible to join them without a foreign or primary key? All the tutorials have had a primary key and a foreign key.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Not really. Is a UNION query appropriate to your needs?

    To your first question, which I didn't notice, the way to avoid multiple parameter prompts is to have the user enter the criteria in a form, and have the queries get it from there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    allstar45 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    35
    Quote Originally Posted by pbaldy View Post
    have the user enter the criteria in a form, and have the queries get it from there.
    That definatly sounds like it would work. I will have to try to find a tutorial of that. Is there any you reccomend?

    I tryed a UNION, which worked, but all the results get pushed into one field, which is definatly not prefered.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    It's pretty simple. Instead of this in a query criteria

    [Enter whatever]

    you have

    Forms!FormName.ControlName

    replacing the form and control names to the actual names.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    allstar45 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    35
    OK I'll try that tomorrow and let you know how it goes!
    Thanks again!

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problem, and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    allstar45 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    35
    Works like a charm! Happy Valentine's day!

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

Similar Threads

  1. Compliling multi step query into single query.
    By dandoescode in forum Access
    Replies: 1
    Last Post: 12-17-2011, 02:21 PM
  2. Multi Criteria Query
    By hawkins in forum Queries
    Replies: 1
    Last Post: 07-18-2011, 01:44 PM
  3. Replies: 1
    Last Post: 12-16-2010, 10:32 AM
  4. Replies: 5
    Last Post: 10-19-2010, 08:02 AM
  5. How to Query a Multi Value Combo Box
    By Viperpurple in forum Queries
    Replies: 0
    Last Post: 03-22-2010, 07:33 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