By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

using query results to search by

P: n/a
hi
i have a query which returns the top 5 Areas of concern
i.e Area(field name)
Area 1
Area 2
Area 3
Area 4
Area 5
the results are displayed on a continuous form
i am now trying to use this result to trigger another query
i need a way of running through the results then finding the faults
with that area
i.e
if result = Area 1 then open query faultsarea1
if result = Area 2 then open query faultsarea2
if result = Area 3 then open query faultsarea3
can anyone help please

thanks kevin

Jul 13 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
kevcar40 wrote:
hi
i have a query which returns the top 5 Areas of concern
i.e Area(field name)
Area 1
Area 2
Area 3
Area 4
Area 5
the results are displayed on a continuous form
i am now trying to use this result to trigger another query
i need a way of running through the results then finding the faults
with that area
i.e
if result = Area 1 then open query faultsarea1
if result = Area 2 then open query faultsarea2
if result = Area 3 then open query faultsarea3
can anyone help please

thanks kevin
Could you define your problem a bit further. You have a recordsource
for the form that displays Area1..5 which has the column name Result if
I understand you correctly.

Now when do you want to run the queries? You could open up the property
sheet for Results, click the Events tab, and in the Dbl-Click event call
your routine to open up the query. Ex:
Dim strQryName As String
strQryName = "faultarea" & result
DOcmd.OpenQuery strQryName

Jul 13 '06 #2

P: n/a

salad wrote:
kevcar40 wrote:
hi
i have a query which returns the top 5 Areas of concern
i.e Area(field name)
Area 1
Area 2
Area 3
Area 4
Area 5
the results are displayed on a continuous form
i am now trying to use this result to trigger another query
i need a way of running through the results then finding the faults
with that area
i.e
if result = Area 1 then open query faultsarea1
if result = Area 2 then open query faultsarea2
if result = Area 3 then open query faultsarea3
can anyone help please

thanks kevin
Could you define your problem a bit further. You have a recordsource
for the form that displays Area1..5 which has the column name Result if
I understand you correctly.

Now when do you want to run the queries? You could open up the property
sheet for Results, click the Events tab, and in the Dbl-Click event call
your routine to open up the query. Ex:
Dim strQryName As String
strQryName = "faultarea" & result
DOcmd.OpenQuery strQryName
thank you for your reply
i will try this code and see how i get on thanks again

Jul 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.