WhereCondition and SubReport

G

Guest

My database keeps the training schedule for my companies training department.
I have a reports form where the user can enter dates, click a command button
and open a report. In the on click event of each command button I have coded
the WhereCondition and open the report using

DoCmd.OpenReport strReportName, acViewPreview, , strWhere.

How can I apply this same WhereCondition to a subreport?

My main report is grouped by Location and then by CourseName. for each
course it displays start and end dates, who taught it, what classroom it was
in, number of student, how many passed, start and end time, and was the
roster turned in. In the sub report, I want to list the course name and next
to each course show how many times it was taught, how many students went
through it, and how many passed. It works great if no date range is entered
on the reports form, however if a date range is used, the main report is
filtered but the sub report still gives totals for every record in the
database. I have tried putting hidden date fields in the sub report and
linking them to the date fields in the main report but this did not work.

Any suggestions anyone?
 
D

Duane Hookom

I generally set the criteria in the subreport's record source query like:

Between Forms!frmdates!txtStart and Forms!frmDates!txtEnd
 

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