help

User Name

Registered User.
Local time
Today, 10:16
Joined
Jun 10, 2003
Messages
26
If I have already set up a query where I have the groupings of information I want but I also on top of this info want to give the user the option to pick which years out of this data they want to put in a report. How can I use the data I already have in the query but only show the years the user wants to use. ex. products grouped by different companies and product type, and then on top of this the user wants to only show the products sold in 1998, 2000 and 2002. How can I do this. Create a form, macro, and alter the query?
 
Use a parameter query and base your report on the query. To create the parameter query, place an expression like this into the criteria line under your year field:
[Please enter the desired years:]

When you open the report (or the query) the user will receive a prompt saying "Please enter the desired years:".

This saves you from having to write any programming code, but users have to know how to enter criteria in "Access speak". For example, to enter those three years you mentioned, the user would have to enter "1998 or 2000 or 2002". It wouldn't undertand "1998, 2000, 2002", nor would it understand the more common "1998-2002". To handle cases like that, you'll need to create a form with a user interface.
 
I can do this for existing queries. Thanks. What can I do for reports that are created from crosstab queries? Can I do the same thing? In the total row what do I classify the years column as?
 
will I have to create a form with a user interface to allow the user the show all of the years?
 
I've never used a parameter in a crosstab query, but I imagine the process is the same. You need to group by the years, and you can choose to let it be a column or row heading.

Using a form will just make it easier on your users to make selections without having to know Access query expressions.
 

Users who are viewing this thread

Back
Top Bottom