Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A97 - mainReport and subReports w/a date range

Status
Not open for further replies.

stellJess

Programmer
Oct 3, 2002
27
0
0
US
Hello TechTip Experts,

I am having a problem with a mainReport and subeports. I need to create a mainReport with two subReports. Maybe i do not need subReports because i only need the grand totals from the subReports to use in calculations on the mainReport (as denominators).

The problem i am running into is that the underlying query’s criteria for the mainReport is a date range (between [startDate] and [endDate]), but the subReports will not use that same date range and provides results from the entire table/query it is based on, not just within the desired date range. so the data does not match and it takes a long time to create the report.

Based on the above, can anyone recommend a better approach and/or suggest how to make the date range work on the subReport as well as on the mainReport?

Any help is greatly welcomed!

stellJess
 
Try to avoid using parameter queries. Create a small form "frmDateRange" with two text boxes "txtStart" and "txtEnd". Set your criteria to:
Between Forms!frmDateRange!txtStart and Forms!frmDateRange!txtEnd
You can do this for the main report as well as the subreports. Make sure you open the form and enter dates. Then run the report.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top