Can the Report Update based on a Query being filtered?

G

Guest

I have a set of queries and reports based on those queries that I have made.
I would like to be able to filter the query by a form, and then have the
report update according to my filter results so I can print the report.

I can filter the query fine, but it won't update on the report. It always
shows the whole unfiltered query on the reports. I don't want to have to
create a new report each time I filter the query.

Any ideas? I am using Access 2007.

Thanks!
Bryan
 
M

Marshall Barton

Bryan said:
I have a set of queries and reports based on those queries that I have made.
I would like to be able to filter the query by a form, and then have the
report update according to my filter results so I can print the report.

I can filter the query fine, but it won't update on the report. It always
shows the whole unfiltered query on the reports. I don't want to have to
create a new report each time I filter the query.


Use a query without criteria for the report. Then specify
the filter by using the OpenReport menthod's WhereCondition
argument (see VBA Help on OpenReport for specifics).
 
C

Chuck

I have a set of queries and reports based on those queries that I have made.
I would like to be able to filter the query by a form, and then have the
report update according to my filter results so I can print the report.

I can filter the query fine, but it won't update on the report. It always
shows the whole unfiltered query on the reports. I don't want to have to
create a new report each time I filter the query.

Any ideas? I am using Access 2007.

Thanks!
Bryan

Make a new form.
Include all the fields from the table(s) that you want to filter by.
Make a command button that opens the report.
Make a command button that will close the form.
In the Query the report is based on, for the criteria of each field the report
is being filtered with - enter: Like [Forms]![<form name>]![field name]

Open form, fill in data to filter by. Enter * in any field you don't want to
filter. Form must stay open.
Click command button to open report.
Report will go to Query, Query will go to form. Report will be filtered by
data in form. Print, save, or whatever. Close report, window will show form
to filter by. Make another choice to open a different report or Click command
button to close form.

Chuck
--
 
G

Guest

Chuck-

Thank you for the help! That is definitely the direction I am wanting to go,
so we have a good start.

In the perfect world, I would be able to have a drop-down list in the form
instead of having to type in the filters and chance mis-spelling...or even
better, "check" boxes that would allow me to pick multiple field values to
filter by instead of only one per report. Does this make sense? Is that
possible?

Thanks again for your help!
Bryan

Chuck said:
I have a set of queries and reports based on those queries that I have made.
I would like to be able to filter the query by a form, and then have the
report update according to my filter results so I can print the report.

I can filter the query fine, but it won't update on the report. It always
shows the whole unfiltered query on the reports. I don't want to have to
create a new report each time I filter the query.

Any ideas? I am using Access 2007.

Thanks!
Bryan

Make a new form.
Include all the fields from the table(s) that you want to filter by.
Make a command button that opens the report.
Make a command button that will close the form.
In the Query the report is based on, for the criteria of each field the report
is being filtered with - enter: Like [Forms]![<form name>]![field name]

Open form, fill in data to filter by. Enter * in any field you don't want to
filter. Form must stay open.
Click command button to open report.
Report will go to Query, Query will go to form. Report will be filtered by
data in form. Print, save, or whatever. Close report, window will show form
to filter by. Make another choice to open a different report or Click command
button to close form.

Chuck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top