using query data as another queries criteria (1 Viewer)

emshim

Registered User.
Local time
Today, 03:31
Joined
Sep 6, 2007
Messages
55
Cannot seem to find an answer to this, but please point me in the correct way if you know of one!

Quite simple i think, but blank mind at moment!

How would i use the values in a table/query as the criteria for another query? I believed i could type in [qryOne]![classification] in the criteria box, but this does not seem to work.

Thanks in advance,

Emily
 

Brianwarnock

Retired
Local time
Today, 03:31
Joined
Jun 2, 2003
Messages
12,701
3 scenarios come to mind here.

1 the values are in a table, if you run the query from a form then the parameter text box can be a dropdown list from the table so that the user can select the value before running the query.

2 you are running several successive queries with the same parameters, again running them from a form means that the data need only be enterd once as it stays available as long as the form is open.

3 You run a query and get a result the data needs to be used to select records in a 2nd query, the first query is used in a join in the 2nd query on the field required.

Brian
 

emshim

Registered User.
Local time
Today, 03:31
Joined
Sep 6, 2007
Messages
55
The 3rd scenario sounds like it! How would i create this join?

Emily
 

Brianwarnock

Retired
Local time
Today, 03:31
Joined
Jun 2, 2003
Messages
12,701
select the first query and the 2nd data source in query design and if using the design grid merly drag one of the fields to the relevent field in the other source a join will appear, ITs worth right clicking on this to see join options although I think you will need number 1 the standard inner join.

If you have never used joins the read about them they are essential db knowledge.

Brian
 

emshim

Registered User.
Local time
Today, 03:31
Joined
Sep 6, 2007
Messages
55
Thanks Brian, that works great! I remember learning that a few years back now, thanks for reminding me!

Emily
 

Users who are viewing this thread

Top Bottom