infomania
Programmer
- Oct 27, 2002
- 148
I have a series of chart reports that need to be filtered by 1 or more field criteria.
The initial query that produced a nice line chart (#Trucks arriving at hour intervals) for ALL data is:
SELECT qryMillArrivalTime.HOUR
, Sum(qryMillArrivalTime.CountOfTRACKING_DATA_ID) AS NBR_TRUCKS
FROM qryMillArrivalTime
GROUP BY qryMillArrivalTime.HOUR;
I modified the query to include an additional field:
SELECT qryMillArrivalTime.HOUR
, Sum(qryMillArrivalTime.CountOfTRACKING_DATA_ID) AS NBR_TRUCKS
, qryMillArrivalTime.MILL
FROM qryMillArrivalTime
GROUP BY qryMillArrivalTime.HOUR,
, qryMillArrivalTime.MILL;
The code to run the reports looks like this:
'stWhereClause set dynamically from a combo box selection
'on the form and passed into this code
stDocName = [Forms]![fmReportSelection]![fmReportSelectionSubform]![REPORT_NAME]
'MsgBox stWhereClause
DoCmd.OpenReport stDocName, acPreview, , stWhereClause
When the report is run, even though the stWhereClause is valid (ex. MsgBox: MILL='TEXARKANA'), the report is not filtered at all.
This filtering method works great on standard reports but the charts don't accept the where criteria.
Any ideas?
Thanks and Happy Holidays.
Infomania
The initial query that produced a nice line chart (#Trucks arriving at hour intervals) for ALL data is:
SELECT qryMillArrivalTime.HOUR
, Sum(qryMillArrivalTime.CountOfTRACKING_DATA_ID) AS NBR_TRUCKS
FROM qryMillArrivalTime
GROUP BY qryMillArrivalTime.HOUR;
I modified the query to include an additional field:
SELECT qryMillArrivalTime.HOUR
, Sum(qryMillArrivalTime.CountOfTRACKING_DATA_ID) AS NBR_TRUCKS
, qryMillArrivalTime.MILL
FROM qryMillArrivalTime
GROUP BY qryMillArrivalTime.HOUR,
, qryMillArrivalTime.MILL;
The code to run the reports looks like this:
'stWhereClause set dynamically from a combo box selection
'on the form and passed into this code
stDocName = [Forms]![fmReportSelection]![fmReportSelectionSubform]![REPORT_NAME]
'MsgBox stWhereClause
DoCmd.OpenReport stDocName, acPreview, , stWhereClause
When the report is run, even though the stWhereClause is valid (ex. MsgBox: MILL='TEXARKANA'), the report is not filtered at all.
This filtering method works great on standard reports but the charts don't accept the where criteria.
Any ideas?
Thanks and Happy Holidays.
Infomania