A query will not do here. There is a solution, but
requires a bit of programming.
1. Design your report so it pulls all the records from
your table
2. Open report from code, usong DoCmd.OpenReport statement
3. DOCmd.OpenReport has several parameters. One parameter
is called WhereCondition (or something like that). You
can create that parameter on the fly (that is where
programming gets involved).
To open the report from code, you need an unbound form,
frmCriteriaBuilder. On this form you select parameter
values from a list box. Then you click a button, which
builds criteria string and opens report.
Examples that would work for you are:
Dim strCriteria as string
Example 1, opens report for Org.type=12:
strCriteria = "[Organization type]=12"
DoCmd.Openreport
ReportName:="YourReport",WhereCondition:=strCriteria
Example 2, opens report for Org.Types 1,3,7,9
strCriteria = "[Organization type] IN (1,3,7,9) "
DoCmd.Openreport
ReportName:="YourReport",WhereCondition:=strCriteria
Example 3, opens report for ALL Org.types
DoCmd.Openreport ReportName:="YourReport"
The question is how to build strCriteria programmatically?
Create a form with a list box. Values in the list box
should be al posible distinct values of [Organization
type]. If you set the list box as "Multi Select", you can
select any combination of [Organization type] values.
Then you build your strCriteria. Look at Access Help for
multi select list boxes, there ar good examples that may
help you.
-----Original Message-----
I have a table that serves as a directory for the
various participants in a construction project . Each
person can be one of 12 different values in
the "Organization type" field -- such as Contractor,
Owner, etc.
i would like to develop a query that enables the user to
select any combination of Organization values (maybe just
1, maybe all 12, or anything in between) and have
that "on-the-fly" query serve as the basis for a Report.