Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering a report

Status
Not open for further replies.

tcolebu

MIS
Aug 24, 2004
6
US
I have created a 30 page report that basically lists employee data for about 20 different people that can be divided into different groups. How can I make the report so that it allows me to enter in the person's name or groups and then run the report for that group onle? Thanks.
 
to filter only the employee you want:

In the query that is the source of the report enter something like [enter name] in the criteria of the field you want to filter. If you have a form in which you run the report from, you could add a field to the form and then refer to it in the criteria of the query.

For example, add a field called "employee" on the form - then in the criteria of your query, you should put:

[forms]![yourformname]![employee] or [forms]![yourformname]![employee] is null

you would obviously replace "yourformname" with the name of your form - this will show all employees if it is left blank and will filter only the employee on the form if one is entered.

Let me know if you need me to expand on this.

Fred
 
I would create a form that contains 2 multiselect list boxes: One from which the user can select 0 or more groups and one from which the user can select 0 or more employees.

Or

You might want to create a single select list box for the groups and an multiselect list box for the employees. When the user selects a group, then the employee list box is filled with just the employees that belong to that group. Now the user can select which employees (0 to many) they want included in the report.

Then check out this FAQ faq181-5497. It contains a function that will build the Where clause for you (without the word Where). You only have to do 3 things to make it work:
1. Create a new module and copy the code from the FAQ and paste it into you new module.
2. Define your Tag property per the FAQ directions.
3. Open your report via the FAQ directions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top