Form entering Report Criteria

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

Guest

I have built a form that prompts the user to select the criteria that they
would like displayed in a report. I have also built a query (which is the
record source for the report) and entered the input parameters into the
query.

When I select the report, the form appears, but it won't set the values. It
just closes the form. I've looked over my macro a dozen times and can't seem
to figure out what's going on.

Any ideas on where to start?
 
Kate, try the other way around. Open the form, and have it open the report.

Typically the form will have the boxes where the user enters their
critieria, and a command button to open the report. In the command button's
Click event, you build the WhereCondition, and OpenReport.

For an example of setting up a command button like that, see:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
 
Thanks for the response. I'm frustrated because I have other reports that
work. But for some reason, this one won't keep the values that I set in the
form. The report now opens, but without any data. The record source for the
report is the Query. So, I'm not sue where to go from here.
 
How are you opening your form:
- code in the report's Open event?
- OpenForm action in a macro?

In what window mode is the form opening:
- normal?
- dialog?

How are you filtering your report:
- parameters in your query?
- WhereCondition of OpenReport?
- applying a Filter to the report?

When the report opens with no records, open the Immediate window (Ctrl+G)
and enter:
? Reports![NameOfYourReportHere].Filter
What reply do you get?

What are the data types of each field you are filtering on? Text? Number,
Date?

What is the SQL for the query that feeds your report? Open it in design
view, switch to SQL View (View menu), and paste the statement here.)
 
Back
Top