L
Leslie Isaacs
Hello All
I have a module that includes the following line:
Set rstS = CurrentDb.OpenRecordset("qry_client_organisation_for_email",
dbOpenSnapshot)
All worked well while I was testing the module, during which I had a dummy
"qry_client_organisation_for_email", the sql for which was:
SELECT practices.[prac name], practices.live, Left([prac name],1) AS Expr1,
practices.email, Right([prac name],1) AS arg
FROM practices
WHERE (((Left([prac name],1))="a") AND ((practices.email) Like "*" &
"gppayroll" & "*") AND ((Right([prac name],1))="e"));
When I substitute the actual "qry_client_organisation_for_email" that I want
to use, and then run the process, I get:
Run-time error 3061. Too few parameters. Expected 1.
and the code stops on the following line:
Set rstS = CurrentDb.OpenRecordset("qry_client_organisation_for_email",
dbOpenSnapshot)
The sql for the actual "qry_client_organisation_for_email" is:
SELECT qryTotalDueByMonth.practice AS [prac name], qryTotalDueByMonth.email
FROM qryTotalDueByMonth
GROUP BY qryTotalDueByMonth.practice, qryTotalDueByMonth.email
HAVING (((qryTotalDueByMonth.practice)="Barms Medical Centre"));
This query runs fine from the main access window, so I cannot understand why
it seems to be a problem when I try to use it as the recordset.
Hope someone can help.
Many thanks
Leslie Isaacs
I have a module that includes the following line:
Set rstS = CurrentDb.OpenRecordset("qry_client_organisation_for_email",
dbOpenSnapshot)
All worked well while I was testing the module, during which I had a dummy
"qry_client_organisation_for_email", the sql for which was:
SELECT practices.[prac name], practices.live, Left([prac name],1) AS Expr1,
practices.email, Right([prac name],1) AS arg
FROM practices
WHERE (((Left([prac name],1))="a") AND ((practices.email) Like "*" &
"gppayroll" & "*") AND ((Right([prac name],1))="e"));
When I substitute the actual "qry_client_organisation_for_email" that I want
to use, and then run the process, I get:
Run-time error 3061. Too few parameters. Expected 1.
and the code stops on the following line:
Set rstS = CurrentDb.OpenRecordset("qry_client_organisation_for_email",
dbOpenSnapshot)
The sql for the actual "qry_client_organisation_for_email" is:
SELECT qryTotalDueByMonth.practice AS [prac name], qryTotalDueByMonth.email
FROM qryTotalDueByMonth
GROUP BY qryTotalDueByMonth.practice, qryTotalDueByMonth.email
HAVING (((qryTotalDueByMonth.practice)="Barms Medical Centre"));
This query runs fine from the main access window, so I cannot understand why
it seems to be a problem when I try to use it as the recordset.
Hope someone can help.
Many thanks
Leslie Isaacs