Results 1 to 5 of 5

Thread: Want to make query dependent on another query.

  1. #1
    Join Date
    Nov 2009
    Posts
    36

    Want to make query dependent on another query.

    Hello to all,
    I am working on project where I am using Microsoft Access 2003 as back end. In Access 2003 I have created 10 fields, on that fields I have to create query. I want to create query on these fields in such a manner that one dependent on the other. It means when one query execute it's dependent query is automatically executed. Can anyone help me to how to make query dependent on another query. Please help me.
    Thank you.
    Last edited by MACE; 01-02-2010 at 05:03 PM.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Want to make query dependent on another query.

    Hey it is very simple to create query dependent on another query. You have to just embed one query's name into another. In this way you have to insert one query's name into another to achieve the result. I have written following code for creating one query dependent on another query. Just try to understand it.

    Code:
     SELECT tableName.[Companys],  tableName.[Companys] FROM tableName   where not(tableName.[Companys]) is null  UNION SELECT "*", "<All>" From tableName
    
     ORDER BY 2;

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Want to make query dependent on another query.

    It is very simple to make one query dependent on another query. You have to use general approach that means you have to use UNION query to achieve this. Just use UNION query and add "<All>" option to it. This "<All>" option is "translated" by the another or second combo query column into a "*". Which is used to enable a LIKE statement in the query. After this you have to force the user to make a selection.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Want to make query dependent on another query.

    You have to create row source to the company table to make query dependent on another query. It is very simple process. You have to just use following SQL query in your program to achieve this. Just try to understand it. It is very simple.

    Code:
    SELECT tableName.[Company],  tableName.[Company] FROM tableName   where not(tableName.[Company]) is null  UNION SELECT "*", "<All>" From tblName
    ORDER BY 2;
    "Order by" is used to combine two or more records.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Want to make query dependent on another query.

    You have to make following setting in your code to achieve this. Just open the query where the record source of the combo box are present. It is the query with the union option. For testing this query you have to create a new empty query. After this paste the "real" query text without the "<All>" union part. After this insert name of first query into another one.

Similar Threads

  1. How to make MS Excel LDAP query
    By denny walter in forum Windows Software
    Replies: 3
    Last Post: 27-11-2010, 06:01 AM
  2. Make a query to find duplicates
    By ASHER in forum Software Development
    Replies: 4
    Last Post: 04-12-2009, 04:47 PM
  3. MySQL query in a query
    By Rail racer in forum Software Development
    Replies: 3
    Last Post: 21-07-2009, 07:06 PM
  4. Turn on MySQL query cache to speed up query performance
    By DMA2Superman in forum Software Development
    Replies: 3
    Last Post: 07-07-2009, 10:26 AM
  5. Replies: 1
    Last Post: 07-02-2008, 10:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,724,173.82870 seconds with 17 queries