REPOST: Subquery?

  • Thread starter Thread starter D Collins
  • Start date Start date
D

D Collins

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.
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top