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

creating a report with parameter query

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
I have created a report that has a subreport within it. The subreport does not relate to the master report (no linking fields). The report and subreport are based on parameter queries. The parameters are derived from a previous form. Is there way of filling in the parameter values to feed the query which feeds the report? I've tried this in the open report event with no luck.
Code:
With CurrentDb.QueryDefs("qryPreRptPayCosts")
        .Parameters("paramStart").Value = Forms!frmRptPaySumParams!dtpStart.Date
        .Parameters("paramEnd").Value = Forms!frmRptPaySumParams!dtpEnd.Date
End With
    With CurrentDb.QueryDefs("qryFinRptPayCosts")
        .Parameters("paramStart").Value = Forms!frmRptPaySumParams!dtpStart.Date
        .Parameters("paramEnd").Value = Forms!frmRptPaySumParams!dtpEnd.Date
End With

Does anyone have any suggestions?

Thanks,
Rewdee
 
Is ths subreport suppose to relate to the master area of the report? If not, then what is your purpose in putting a non related report into one another? If you are trying to pass parameter, I suggest doing it in a saved query. Can you verify my question first please?

Network Security( CCNA, CISSP)
Sell Shopping Cart/Merchant Account
Access Expert
rsmith@litsllc.com
 
Based your report and your subreport on saved queries that reference the controls on the form with your parameter values. Include a button on that form to open the report, since you must have the form with the parameters open when you run (open) the report.

You don't indicate if you are getting some kind of error message, just that you've tried parameters "with no luck". What message(s) did you get?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top