Use Query Result As Criteria For Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok, I am lost and just can't get on track here, I know you can do somethign
like this but I can't figure it out.

I have a query that takes some values from a form and with that I get a
result, which is a location, it will always be only the one value that is
returned.

I then need to take the result from this query, the location, and use it as
a criteria for another query.

How do I do this, I either can't get the syntax right, or I am going about
this all the wrong way, some assistance on this would be greatly appreciated.

Thanks,
James Stephens
 
Assuming it always only returns one value I would use a DLookup function in
the criteria of your final query.

DLookup("your field name here", "your query name here")

Seth
 
Well, you could use the first query as a subquery in the WHERE clause of the
second query. IF you post the SQL text of your two queries and specify which
field you are applying the query against, someone could probably write the query
for you.

In the query grid:
Field: SearchThisField
Criteria: IN (SELECT Location FROM YourOtherTable WHERE SomeField = [Forms]![FormName]!ComboboxA)
 
Back
Top