Criteria

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

I have a form which allows the user to select different
criteria for what type of report the user needs. For
instance the user can select all customers or an
individual customer. However, I want to allow the user to
select dates for these reports as well. My question do I
need to make a separate report for each different
selection and also do I need to make a separate query for
each of these reports? If yes then that will suffice if
no then do you have any suggestions on how to perform
this? I would prefer not making 30 different reports with
querys.

thanks for any help
 
You only need one report based on a query. In the query you will specify
which records to include. If you have a form called ReportParameters with a
'CustNo' field, a 'StartDate' field, and a 'EndDate' field, for example....

Your query will have a field for the customer number. In the criteria you
would enter something like....

Like [Forms]![ReportParameters]![CustNo] & "*"

This method will pull all records if the user leaves the field blank (Like
"*").

For the date field you would use a criteria like...

Between [Forms]![ReportParameters]![StartDate] and
[Forms]![ReportParameters]![EndDate]

Note: The report parameters form must remain open while the report is
produced. You could hide it, but it must be open.

In your report onclose event, don't forget to set the values of each of the
fields on your form back to "" so the form will be clean when the next user
opens it. Also, in the same event procedure, close your report parameters
form.

Hope That Helps.

Rick B




I have a form which allows the user to select different
criteria for what type of report the user needs. For
instance the user can select all customers or an
individual customer. However, I want to allow the user to
select dates for these reports as well. My question do I
need to make a separate report for each different
selection and also do I need to make a separate query for
each of these reports? If yes then that will suffice if
no then do you have any suggestions on how to perform
this? I would prefer not making 30 different reports with
querys.

thanks for any help
 
Thanks for the response. I realized part of what you
said. However, my thing is since the user can pick from 3
different types of customers. Then they can select
information they want to see about the customers. Then
they can select the dates for these customers or they can
leave the dates blank and get all the dates of these
customers. So the Between [Forms]![ReportParameters]!
[StartDate] and [Forms]![ReportParameters]![EndDate]
portion would cause my form to deliver the criteria to the
query. Thanks for any further input.
 
1 more question: how would you change the title of the
report to reflect the type of customers by selecting from
the criteria?

Thanks
 
Use an unbound text box as your title. Put something like:

=[CustType] & " Customer Report for " & format([StartDate],"short date") & "
through " & format([EndDate],"short date")

This will result in something like:

Retail Customer Report for 04/01/04 through 04/15/04


HTH

Rick B


1 more question: how would you change the title of the
report to reflect the type of customers by selecting from
the criteria?

Thanks
 
Back
Top