I am hoping some of the expert help on this forum can again help me solve a problem. In advance, sorry for the length of this.
I have a set of reports which display data in different grids primarily by location and date.
They are complicated by the fact that the monthly and yearly (by month) reports require multiple queries and levels of queries to report only one entry per month which must be the max valued version and/or the last.
As a result the reports have different queries and I have them set up as Subreports in the Report Footer.
The Monthly turned out to be straightforward as the two grids were based on the same simple query and the other 3 values could be calculated, I was able to pass the parameters into the queries for Location/Month/Year by setting them up in a select a report form and referencing them through.
Forms![fmSelectaReport]![LocationCombo] etc.
The Yearly report with a pointer from Paul, is a set of Crosstab queries which references the 3 level simple query. I am able to pass the Report Year parameter into the Report using openArgs in openReport.
DoCmd.OpenReport "YrFMSRep", acViewPreview, "", "", acNormal, "[ReportYear]=" & ReportYear
In the third set of reports - the Weeklies, I again have a set of straightforward grids based on simple queries which I was able use the Form to pass the StartDate and EndDate.
The last weekly report is a bit tricky - I need to again pass both the StartDate and EndDate into a multiple level query,
I have it set up as a simple query, WkRecords which collects all the records for the interval requested and sorts them by week.
Then 4 crosstab queries set the data up in grids with location across the columns and week in the rows for the Subreports.
The report works fine with a set of dates hard coded into the Simple query WkRecords.
I tried passing the 2 parameters - StartDate and EndDate in from the Form using Forms![fmSelectaReport]![WkStartDate]
but I got a error that the database engine didn't recognize it. I found something on this forum about putting the parameters
in the Queries -> Parameters and tried that - don't get the error anymore but there is no data in the reports.
I also tried passing the 2 parameters in the open Args with a | in the OpenReport
DoCmd.OpenReport "WkFMSRep", acViewPreview, "", "", acNormal, StartDate & "|" & EndDate
Splitting the openArgs in the OnOpen event of the Report
The Parameters seem to be being passed correctly there are no type errors, however the queries are obviously not getting the information, I get pop up windows asking for StartDate and EndDate and when I type values in multiple times I still get a blank report.
Seems like I have missed something to connect the parameters back to the query.
I have a set of reports which display data in different grids primarily by location and date.
They are complicated by the fact that the monthly and yearly (by month) reports require multiple queries and levels of queries to report only one entry per month which must be the max valued version and/or the last.
As a result the reports have different queries and I have them set up as Subreports in the Report Footer.
The Monthly turned out to be straightforward as the two grids were based on the same simple query and the other 3 values could be calculated, I was able to pass the parameters into the queries for Location/Month/Year by setting them up in a select a report form and referencing them through.
Forms![fmSelectaReport]![LocationCombo] etc.
The Yearly report with a pointer from Paul, is a set of Crosstab queries which references the 3 level simple query. I am able to pass the Report Year parameter into the Report using openArgs in openReport.
DoCmd.OpenReport "YrFMSRep", acViewPreview, "", "", acNormal, "[ReportYear]=" & ReportYear
In the third set of reports - the Weeklies, I again have a set of straightforward grids based on simple queries which I was able use the Form to pass the StartDate and EndDate.
The last weekly report is a bit tricky - I need to again pass both the StartDate and EndDate into a multiple level query,
I have it set up as a simple query, WkRecords which collects all the records for the interval requested and sorts them by week.
Then 4 crosstab queries set the data up in grids with location across the columns and week in the rows for the Subreports.
The report works fine with a set of dates hard coded into the Simple query WkRecords.
I tried passing the 2 parameters - StartDate and EndDate in from the Form using Forms![fmSelectaReport]![WkStartDate]
but I got a error that the database engine didn't recognize it. I found something on this forum about putting the parameters
in the Queries -> Parameters and tried that - don't get the error anymore but there is no data in the reports.
I also tried passing the 2 parameters in the open Args with a | in the OpenReport
DoCmd.OpenReport "WkFMSRep", acViewPreview, "", "", acNormal, StartDate & "|" & EndDate
Splitting the openArgs in the OnOpen event of the Report
The Parameters seem to be being passed correctly there are no type errors, however the queries are obviously not getting the information, I get pop up windows asking for StartDate and EndDate and when I type values in multiple times I still get a blank report.
Seems like I have missed something to connect the parameters back to the query.