The following is giving me a syntax error (Error 3061: Too few parameters. Expected 1.)
Set rst = dbs.OpenRecordset("SELECT Sum(Ahrs)+Sum(Bhrs)+
Sum(Chrs) AS Expr2 FROM Production
WHERE (((DatePart('m',[proddate]))=DatePart('m',Forms!PROD_Main!Text21)));")
The problem is in:
=DatePart('m',Forms!PROD_Main!Text21)));")
If I replace it with:
=Month(Now())));")
....it works fine.
Tried several variations without success. Any help is much appreciated.
Set rst = dbs.OpenRecordset("SELECT Sum(Ahrs)+Sum(Bhrs)+
Sum(Chrs) AS Expr2 FROM Production
WHERE (((DatePart('m',[proddate]))=DatePart('m',Forms!PROD_Main!Text21)));")
The problem is in:
=DatePart('m',Forms!PROD_Main!Text21)));")
If I replace it with:
=Month(Now())));")
....it works fine.
Tried several variations without success. Any help is much appreciated.