Using a form filter to print report

E

EH

hello all.

Just a quick question. I have a form, and a button that runs a parameter
query (filter) to get the information the user wants listed on the continuous
form.

I have another button that brings up a form in which the user must enter in
2 items for a final report. My question is, I need the information from the
first form (after the filter is run), along with this other forms 2 fields.

Basically All the filtered information from Form1 (which is mostly static
but may be changed on the form), and the 2 fields of information (which
changes upon every printing) on the end report.

I tried using Form1's filter but it is a parameter query and I dont want it
to ask for the filter again.

Thanks much for any help.
 
L

Larry Linson

If you are going to always provide the "filter" data via a form, use the
WhereCondition argument of the DoCmd.OpenReport and eliminate the
parameter(s) from the query.

That will, of course, limit running the report directly, but I generally
provide an easier method for my users, so don't feel it is useful for them
to run queries directly in my applications (even when it is an application
just for my own use).

Larry Linson
Microsoft Access MVP
 
E

EH

The button will prompt them for a parameter, basically a search button. This
will show them the data they need in the Continuous Form they pushed the
search button from.

Its that data that I need to get printed, without prompting them again for
the parameter, the data that is within the continuous form.

Basically I need a way to print the results of the search, anytime after the
search is run, not a button to run the query AND the report.
 
L

Larry Linson

"EH" wrote
Basically I need a way to print the
results of the search, anytime after the
search is run, not a button to run the
query AND the report.

If the Form into which the user entered the search criteria is not still
open when you need the data, then you need to save it prior to closing that
Form -- you can save it in one of a number of places: a Control (visible or
invisible) in a Form that will be open, a public Variable in the module of a
Form that will continue to be open until the report is run, or a Public
variable in a standard Module.

Nothing you have described indicates a _need_ for a parameter on the Query.

Larry Linson
Microsoft Access MVP
 

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