sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
kevcar40's Avatar

using query results to search by


Question posted by: kevcar40 (Guest) on July 13th, 2006 08:25 AM
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

2 Answers Posted
salad's Avatar
Guest - n/a Posts
#2: Re: using query results to search by

kevcar40 wrote:
Quote:
Originally Posted by
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



kevcar40's Avatar
Guest - n/a Posts
#3: Re: using query results to search by


salad wrote:
Quote:
Originally Posted by
kevcar40 wrote:
>
Quote:
Originally Posted by
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

 
Not the answer you were looking for? Post your question . . .
196,989 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,989 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors