Selected record as query criteria

C

Chris Moore

Is there anyway to reference a specific field of a selected record in a form
or table and use that particular field's value as the criteria for a query?
For example I have a form that displays some summarized employee data
(employee's name, sum of the employee's sales, count of the number of sales
the employee made). The data is displayed in spreadsheet format. I want a
user to be able to highlight or click the row for a specific employee, click
a button, and then be able to see the detail behind the summarized data
either in another form or subform. To do that I would need a query references
the value in the employee name column of the selected record. Can this be
done? If not are there any workarounds?
 
D

Dorian

If your data could be displayed in a listbox, then you can access the
selected item in a function and move the value to a hidden control on the
form. You could then reference that hidden control in a query.
There are many other ways to do it.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
C

Chris Moore

Thanks for your reply Dorian. Could you elaborate on some of the other ways
to accomplish this? The list box wouldn't work so well for me because I need
the users to be able to browse the overall data in something that looks like
a spreadsheet...
 

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

Top