Code to display values of a query

  • Thread starter Thread starter bigbore50
  • Start date Start date
B

bigbore50

Hello,

Thanks in advance

I am having a problem remembering how to do this. Or maybe it can't be
done at all. Please Help

I have a query in access that brings up results for one specific
person.
this query brings up the last 3 places this person went to based on
most recet dates

This is what my query shows.

Exp: person place date
john doe pittsburgh 10/21/06
john doe harrisburgh 9/15/06
john doe dayton 8/12/06

Now what i want to do is write code to open this query and return
results of the places.

I want it to set the variables place1 = pittsburgh
place2 = harrisburgh
place3 = dayton

Then i will use these variable to search another query based on these
variables.

I thought i could use a loop and a count to count through the records
and just return the value based on the loop, because the places that
the people visit can = many different times and dates.

Can this be done?
 
Now what i want to do is write code to open this query and return
results of the places.

I want it to set the variables place1 = pittsburgh...etc.

You don't need to do that. All you need to do is to use the existing query as
a sub-query to the upper query, using an appropriate JOIN, and adding a WHERE
clause, such as WHERE ThePlace = TheSubQuery.Place

Hope this helps,

Sam
 
Thanks,

I never tought of that, I have not used access or tried to code in a
year so i have been forgetting stupid things
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top