If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
REPOST: Subquery?
Hello,
I have a 3-table query that gathers it's criteria from a Criteria Selection Form (This works fine). After I get the results from this query, I would like to do another query that uses the result from the first query to compare to a table of all possible choices to see what might not be matched. I can get this to work by creating the 2 queries separately. The problem is that I want the final result to be the record source for a report when I click on the preview button from the selection form. I have tried to copy the SQL, but my dilema is that I need to pass the criteria to the first query, then from that query result create another SQL string to find unmatched, and to throw a wrench in it, use a piece of criteria from the first query. I think I might have to create a temp table and use that, or can I use subqueries? Any help would be appreciated. Thanks. |
#2
|
|||
|
|||
REPOST: Subquery?
You can use a (hidden) form with a text control holding the value of the
parameter. You can use a user defined VBA public function in a standard module which will return, somehow, the parameter value. You can use a temp table, created in the front end part (so, if more than one user is using the report, each different user will have the possibility to have different parameter, while running the same basic report) if that is possible. The front end will have to call the query, defined in the backend, since the back end will have no way, all by itself, to know anything particular to the front end. All considered, that is harder to code than any of the previous two possibilities. Vanderghast, Access MVP "D Collins" wrote in message ... Hello, I have a 3-table query that gathers it's criteria from a Criteria Selection Form (This works fine). After I get the results from this query, I would like to do another query that uses the result from the first query to compare to a table of all possible choices to see what might not be matched. I can get this to work by creating the 2 queries separately. The problem is that I want the final result to be the record source for a report when I click on the preview button from the selection form. I have tried to copy the SQL, but my dilema is that I need to pass the criteria to the first query, then from that query result create another SQL string to find unmatched, and to throw a wrench in it, use a piece of criteria from the first query. I think I might have to create a temp table and use that, or can I use subqueries? Any help would be appreciated. Thanks. |
#3
|
|||
|
|||
REPOST: Subquery?
Post the SQL of the first query that gathers it's criteria from a Criteria
Selection Form. Then post the SQL of the two other queries you want to have in the final. Them someone can pull it all together for you. -- KARL DEWEY Build a little - Test a little "D Collins" wrote: Hello, I have a 3-table query that gathers it's criteria from a Criteria Selection Form (This works fine). After I get the results from this query, I would like to do another query that uses the result from the first query to compare to a table of all possible choices to see what might not be matched. I can get this to work by creating the 2 queries separately. The problem is that I want the final result to be the record source for a report when I click on the preview button from the selection form. I have tried to copy the SQL, but my dilema is that I need to pass the criteria to the first query, then from that query result create another SQL string to find unmatched, and to throw a wrench in it, use a piece of criteria from the first query. I think I might have to create a temp table and use that, or can I use subqueries? Any help would be appreciated. Thanks. |
Thread Tools | |
Display Modes | |
|
|