C
croy
Two querys, the first one feeding the second.
The first query runs fine, but the second throws an error,
complaining that a data source in the first query isn't
acceptable.
This query (qry0041_cht2) works fine:
SELECT tblIvSurv.SurveyDate, tblHours.ChartHour,
[NumberAnglers]*[AnglerHours] AS AnglersPerHour,
IIf([ChartHour] Between [IvTime] And
([IvTime]-([HrsFished]/24)),1,0) AS AnglerHours,
IIf((Weekday([SurveyDate])=1) Or
(Weekday([SurveyDate])=7),"Weekend Day","Weekday") AS
DayType, tblIvSurv.GeoLocId, tblGeoLoc.GeoLocName
FROM tblHours, (tblGeoLoc INNER JOIN (tblLocPicker INNER
JOIN tblIvSurv ON tblLocPicker.GeoLocId =
tblIvSurv.GeoLocId) ON tblGeoLoc.GeoLocId =
tblIvSurv.GeoLocId) INNER JOIN tblIvDetail ON
tblIvSurv.IvSurvId = tblIvDetail.IvSurvId
WHERE (((tblIvSurv.SurveyDate) Between
[Forms]![frmStartReport_AnglerEffort]![txtFrom] And
[Forms]![frmStartReport_AnglerEffort]![txtTo]) AND
((tblIvDetail.Done)=-1));
But the next query in the chain (qry0041_cht2):
TRANSFORM Sum(qry0041_cht.AnglersPerHour) AS
SumOfAnglersPerHour
SELECT qry0041_cht.ChartHour
FROM qry0041_cht
GROUP BY qry0041_cht.ChartHour
PIVOT qry0041_cht.DayType;
....this error is returned:
"The Microsoft Jet database engine does not recognize
'[Forms]![frmStartReport_AnglerEffort]![txtFrom]' as a valid
field name or expression."
All that feeds the second query is the first one, and the
first one runs fine. How can the second have a problem with
a data source of the first?
The first query runs fine, but the second throws an error,
complaining that a data source in the first query isn't
acceptable.
This query (qry0041_cht2) works fine:
SELECT tblIvSurv.SurveyDate, tblHours.ChartHour,
[NumberAnglers]*[AnglerHours] AS AnglersPerHour,
IIf([ChartHour] Between [IvTime] And
([IvTime]-([HrsFished]/24)),1,0) AS AnglerHours,
IIf((Weekday([SurveyDate])=1) Or
(Weekday([SurveyDate])=7),"Weekend Day","Weekday") AS
DayType, tblIvSurv.GeoLocId, tblGeoLoc.GeoLocName
FROM tblHours, (tblGeoLoc INNER JOIN (tblLocPicker INNER
JOIN tblIvSurv ON tblLocPicker.GeoLocId =
tblIvSurv.GeoLocId) ON tblGeoLoc.GeoLocId =
tblIvSurv.GeoLocId) INNER JOIN tblIvDetail ON
tblIvSurv.IvSurvId = tblIvDetail.IvSurvId
WHERE (((tblIvSurv.SurveyDate) Between
[Forms]![frmStartReport_AnglerEffort]![txtFrom] And
[Forms]![frmStartReport_AnglerEffort]![txtTo]) AND
((tblIvDetail.Done)=-1));
But the next query in the chain (qry0041_cht2):
TRANSFORM Sum(qry0041_cht.AnglersPerHour) AS
SumOfAnglersPerHour
SELECT qry0041_cht.ChartHour
FROM qry0041_cht
GROUP BY qry0041_cht.ChartHour
PIVOT qry0041_cht.DayType;
....this error is returned:
"The Microsoft Jet database engine does not recognize
'[Forms]![frmStartReport_AnglerEffort]![txtFrom]' as a valid
field name or expression."
All that feeds the second query is the first one, and the
first one runs fine. How can the second have a problem with
a data source of the first?