"OK" Macro: maybe not set up correctly?

G

Guest

I'm trying to create a report where the the user can enter criteria
(beginning date, end date) to generate a report. (Using the Acess Help file
instructions to create Macros while creating a form to enter report criteria)

*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????

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 advice is greatly appreciated.
 
A

AlCamp

Bark,
If you have a [StartDate] and [EndDate] on your criteria form (ex. name
frmCriteria), then in the query for the report needs to use those values to
filter the records returned to the report.
In the Date field of your report query you'll need a criteria like
this... (use your own names)

Between Forms!frmCriteria!StartDate AND Forms!frmCriteria!EndDate

This will only return records between the two dates on your form.
hth
Al Camp
 

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