T
tw
Access 2002
I have this saved query as qryWeeklyVisits1, and it works fine it takes the
date for the where clause between statement from the form and runs code to
determine Sunday and Saturday dates around the date in that form.
SELECT DISTINCT [LCM Acutal Visits].[LCMV-FK Cert Period], [LCM Acutal
Visits].[LCMV-FK Type of Visit], [LCM Acutal Visits].[LCMV DOS]
FROM [LCM Acutal Visits]
WHERE ((([LCM Acutal Visits].[LCMV DOS]) Between
beginningofweek([forms]![frmqryonedateparameter].[txtdate].[value]) And
endofweek([forms]![frmqryonedateparameter].[txtdate].[value])));
and this saved query as qryWeeklyVisits2, and it works fine
SELECT DISTINCT WorkSpaceDoctorsOrders.[DO-FK Cert Period id],
WorkSpaceDoctorsOrders.[DO-FK Type of Visit], 0 AS Expr1
FROM WorkSpaceDoctorsOrders;
and this saved query as qryWeeklyVisitsUnion, and it works fine
Select *
From [qryWeeklyVisits1]
UNION Select *
From [qryWeeklyVisits2];
all three of these queries work as I want them to work when I run them from
the query window
here is my problem...
I have this code in vba on the sub txtDate_AfterUpdate event
<snip>
strSqlP = "select * from qryWeeklyVisitsUnion Order by [lcmv-fk cert period]
& [LCMV-FK type of visit]"
Set rsp = CurrentDb.OpenRecordset(strSqlP)
I'm getting an error message "Too few parameters: Expected 1"
I'm not sure if the parameter it is expecting is
form!frmqryOneDateParameter.txtDate, but the form is still there with a
date. It's from that field's AfterUpdate event that this code is running.
Can anyone see what may be wrong?
I have this saved query as qryWeeklyVisits1, and it works fine it takes the
date for the where clause between statement from the form and runs code to
determine Sunday and Saturday dates around the date in that form.
SELECT DISTINCT [LCM Acutal Visits].[LCMV-FK Cert Period], [LCM Acutal
Visits].[LCMV-FK Type of Visit], [LCM Acutal Visits].[LCMV DOS]
FROM [LCM Acutal Visits]
WHERE ((([LCM Acutal Visits].[LCMV DOS]) Between
beginningofweek([forms]![frmqryonedateparameter].[txtdate].[value]) And
endofweek([forms]![frmqryonedateparameter].[txtdate].[value])));
and this saved query as qryWeeklyVisits2, and it works fine
SELECT DISTINCT WorkSpaceDoctorsOrders.[DO-FK Cert Period id],
WorkSpaceDoctorsOrders.[DO-FK Type of Visit], 0 AS Expr1
FROM WorkSpaceDoctorsOrders;
and this saved query as qryWeeklyVisitsUnion, and it works fine
Select *
From [qryWeeklyVisits1]
UNION Select *
From [qryWeeklyVisits2];
all three of these queries work as I want them to work when I run them from
the query window
here is my problem...
I have this code in vba on the sub txtDate_AfterUpdate event
<snip>
strSqlP = "select * from qryWeeklyVisitsUnion Order by [lcmv-fk cert period]
& [LCMV-FK type of visit]"
Set rsp = CurrentDb.OpenRecordset(strSqlP)
I'm getting an error message "Too few parameters: Expected 1"
I'm not sure if the parameter it is expecting is
form!frmqryOneDateParameter.txtDate, but the form is still there with a
date. It's from that field's AfterUpdate event that this code is running.
Can anyone see what may be wrong?