L
Lisa
I have a table of projects in my database, and a table of employees in
a M2M relationship. I want to make a query that generates a list of
projects that any one person is involved with and then use the query to
create a report. I have created a form that allows the user to select
an Employee Name. They can then click the "Create Report" button. The
report uses a query to filter the data to display. In the query I'm
using the following criteria:
Like [forms]![frmReportFilter]![EmployeeName] & "*"
to pull the desired criteria from the form and create the report. This
works beautifully IF the Employee Name field is given a value in the
form.
The problem is that if the Employee Name field in the form is left
blank, the report creates a seperate page for each employee in the
entire database and filters out any projects that don't have any
employees assigned. The result I'd like to have is that IF the
Employee Name field is left blank in the form, that the query ignore
this criteria completely. I've tried adding "And Is Not Null" to the
criteria described above but I think I'm off base there. If I don't
use the asterisk in the above criteria, the filter doesn't work at all,
even if an EmployeeName is provided.
Am I making any sense here?? How do I create a query (for a report)
that will only apply the criteria when the EmployeeName field is
populated?
Thanks so much.
a M2M relationship. I want to make a query that generates a list of
projects that any one person is involved with and then use the query to
create a report. I have created a form that allows the user to select
an Employee Name. They can then click the "Create Report" button. The
report uses a query to filter the data to display. In the query I'm
using the following criteria:
Like [forms]![frmReportFilter]![EmployeeName] & "*"
to pull the desired criteria from the form and create the report. This
works beautifully IF the Employee Name field is given a value in the
form.
The problem is that if the Employee Name field in the form is left
blank, the report creates a seperate page for each employee in the
entire database and filters out any projects that don't have any
employees assigned. The result I'd like to have is that IF the
Employee Name field is left blank in the form, that the query ignore
this criteria completely. I've tried adding "And Is Not Null" to the
criteria described above but I think I'm off base there. If I don't
use the asterisk in the above criteria, the filter doesn't work at all,
even if an EmployeeName is provided.
Am I making any sense here?? How do I create a query (for a report)
that will only apply the criteria when the EmployeeName field is
populated?
Thanks so much.