From: Rose on
I am trying to find the easiest method to write code which would allow me to
open a report from a form linking up to five fields. For example: I have a
form linked to a table that contains hundreds of jobs (tblJobs). In the form
I want to be able to click a command button and pull up a report on the
potential clients (tblClients) who fit the matching criteria in the current
form. The criteria fields may be City, Job Category, Age Requirement, etc.
Any thoughts?
--
Rose
From: Allen Browne on
The most flexible way is to use the WhereCondition of OpenReport, so you can
use any combination of criteria that the user chose to fill out on your
form.

Here's a really simple example of how the WhereCondition works, using just
one field:
http://allenbrowne.com/casu-15.html

Here's an example that shows how to create the WhereCondition from several
criteria:
http://allenbrowne.com/ser-62.html
That one includes a downloadable example that shows the matching results in
a form. The process for filtering the report is identical.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Rose" <Rose(a)discussions.microsoft.com> wrote in message
news:8CAECF32-C182-4BC4-917B-6A7D321AC890(a)microsoft.com...
> I am trying to find the easiest method to write code which would allow me
> to
> open a report from a form linking up to five fields. For example: I
> have a
> form linked to a table that contains hundreds of jobs (tblJobs). In the
> form
> I want to be able to click a command button and pull up a report on the
> potential clients (tblClients) who fit the matching criteria in the
> current
> form. The criteria fields may be City, Job Category, Age Requirement,
> etc.
> Any thoughts?
> --
> Rose