A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

REPOST: Subquery?



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2008, 03:57 PM posted to microsoft.public.access.queries
D Collins
external usenet poster
 
Posts: 6
Default 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  
Old June 3rd, 2008, 04:18 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default 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  
Old June 3rd, 2008, 08:36 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.