Re: The Microsoft Jet database engine does not recognize...
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Sat, 17 Jan 2009 10:38:21 +0900
In the first query, try explicitly declaring your parameters:
1. Open qry0041_cht2 in design view.
2. Choose Parameters on the Query menu.
Access opens a dialog.
3. Enter 2 rows in the dialog:
[Forms]![frmStartReport_AnglerEffort]![txtFrom] Date
[Forms]![frmStartReport_AnglerEffort]![txtTo]) Date
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"croy" <croy@xxxxxxxxxxx> wrote in message
news:oft1n4hddk2b83l2qtvpd6702rrp93e9q1@xxxxxxxxxx
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?
--
Thanks
croy
- Follow-Ups:
- References:
- Prev by Date: Re: trouble converting SQL subquery to stacked saved queries
- Next by Date: Re: Parameter queries
- Previous by thread: The Microsoft Jet database engine does not recognize...
- Next by thread: Re: The Microsoft Jet database engine does not recognize...
- Index(es):
Relevant Pages
|