The following code is giving me error 3061 (Too few parameters. Expected 1.)
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set cld = Me!Classified
Set rst = dbs.OpenRecordset("SELECT [classdate],
Sum(quantity) AS Expr1
FROM Classification " _
WHERE ClassDate = Forms!prod_main!text21
GROUP BY ClassDate;
cld.Value = rst("Expr1")
---
If I replace the form control in the WHERE clause with "date()", it returns the sum for today (as expected). I can't find the syntax for the form control. I've tried putting pound signs around it and a number of other variations, but no luck.
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set cld = Me!Classified
Set rst = dbs.OpenRecordset("SELECT [classdate],
Sum(quantity) AS Expr1
FROM Classification " _
WHERE ClassDate = Forms!prod_main!text21
GROUP BY ClassDate;
cld.Value = rst("Expr1")
---
If I replace the form control in the WHERE clause with "date()", it returns the sum for today (as expected). I can't find the syntax for the form control. I've tried putting pound signs around it and a number of other variations, but no luck.