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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specifying different criteria for Subreports

Status
Not open for further replies.

farcanal

IS-IT--Management
Jun 29, 2006
9
ZA
Hi
I have a report containing two subreports (all unbound).
I would like to open the report and specify different criteria for each of the subreports.
For example the 1st subreport contains data pertaining to an "Event Date" that the user selects off a drop down on a form - the second subreport shows data pertaining to a range of dates ie between a "Start Date" and an "End Date" also selected by the user on the form.
I can get both subreports to work individually with the selected criteria - but how do I get the main report to display with the required subreports?
My seperate subreport code (so far)...
1.
stDocName = "Subreport - Momentum Maturities - By EVENT DT"
stLinkCriteria = "[Event Date]=" & Me![Combo3]
DoCmd.OpenReport stDocName, acViewPreview, ,stLinkCriteria
...

AND ...
2.
stDocName = "Subreport - Momentum Maturities - YTD by MONTH"
stLinkCriteria = "[Event Date] Between " & Me![Combo5] & " and " & Me![Combo7]
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria

Any ideas please???

Thanks alot
 
It may be best to set the recordsource for the subform to reference the combo, rather than using a filter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top