multiple criterias for one report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have a report which uses two recordsources, depending on what language is used or/and what province the user selects in the list box before running the report

Currently, i have two queries, one for french and one for english. In the criteria row of the querie i have forms!frmProvince!lstProvince.value, which takes the value selected in the list box as the criteria for the report

Question

Can i programmatically change the criteria such that if the user is on a specific form to run the report, i can change the criteria for the report based on what they have selected. Basically i am trying to reduce the number of queries i need to create and reduced the over all size and number of queries in the application

Thanks in advance for hte help

Carlee
 
Carlee said:
I have a report which uses two recordsources, depending on what language is used or/and what province the user selects in the list box before running the report.

Currently, i have two queries, one for french and one for english. In the criteria row of the querie i have forms!frmProvince!lstProvince.value, which takes the value selected in the list box as the criteria for the report.

Question:

Can i programmatically change the criteria such that if the user is on a specific form to run the report, i can change the criteria for the report based on what they have selected. Basically i am trying to reduce the number of queries i need to create and reduced the over all size and number of queries in the application.


Not sure I understand what you want, but I suspect that you
can get rid of the criteria in the query and use the
OpenReport method's WhereCondition argument instead.

If each of your forms has a button to print the report, the
code in the button's Click event can specify a different set
of criteria while the report uses a single query for all
versions.

If your existing two queries select different fields from a
table or if they are based on different tables, then you can
set a Public variable in a standard module so the report's
open event can set its own RecordSource.
 
Back
Top