Re: The Microsoft Jet database engine does not recognize...



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
.



Relevant Pages

  • Re: Duplicate Label_id History
    ... First query: Return just the scans you are interested in ... INNER JOIN (ScannAction ... FROM AccountAction INNER JOIN (ScannAction INNER JOIN (Employees RIGHT ...
    (microsoft.public.access.queries)
  • Re: Query not updatable - advise on how to change it
    ... The second query links the first query to the employee table where I can ... UPDATE qrySafetyExpired INNER JOIN tblEmployees ON qrySafetyExpired.IP_ID = ... one contains employee data and the second contains a list of courses that they have taken which includes dates. ... My first query to find the list of employees with expired courses is a group query: ...
    (microsoft.public.access.queries)
  • Re: Database-Query and AutoFill??????
    ... first query, so it gets data from both source tables. ... rightmost one - leave no gaps) with formula, which will retrieve according ... In data range properties for first query, ... > values of coloumn 1 and 2. ...
    (microsoft.public.excel.misc)
  • Re: Repost - help to merge 2 queries
    ... this is what the final query looks like: ... The restriction on naming is due to the fact that Access SQL won't allow ... I want to run a single query that has inner joins across 2 tables:2 fields ... The first query pulls back the data I need: ...
    (microsoft.public.access.queries)
  • Re: Can These Queries Be Combined?
    ... Thats what the AS qryMultipleBucks does. ... qryMultipleBucks (I DELETED THE QUERY MultipleBucks) INNER JOIN ... The first query idenifies those ...
    (microsoft.public.access.queries)