Form to Enter Report Criteria works, but Query won't run from Macr

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create a report where the the user can enter criteria
(beginning date, end date) to generate a report.

*I've created a form to enter the criteria. (with macros "ok", "cancel").
*I've created the query to generate the report.

The query itself works. The form opens and allows me to enter the criteria.

However, they don't seem to work together. When I open the form, enter the
criteria, and click "ok" (macro), it doesn't seem to know to run the query.
Instead, it pulls all of the records from the record source. How can I get
the criteria form to work with the actual query - and get it to show in the
report????

(Just a thought... is there something I can do with my "OK" macro that is
clicked after the criteria is entered? Something that would get my criteria
into the query?)

Any advise is greatly appreciated.
 
One way of getting the query and form to work together is to refer to the
form in the criteria of the query. For this to work, the form must be open
(visible, yes or no is ok). If you hide the form when you click Ok, close
the form when you close the report.

Example criteria:
Forms!frmMyForm!txtMyTextbox
 
Back
Top