I am using DCount to 'grab' a value resulting from running a query.
If DCount("[PassCodeResult]", "[PassCodeQuery]",[PassCodeResult]="Fail") > 0 Then ....etc
PassCodeQuery's SQL is :
SELECT [Enter Passcode1] AS PassCodeResult
FROM Table1;
Works fine, but my query needs to contain parameters eg [Enter Passcode1]. When I include a Parameter in the underlying query, I get a message saying ...
"The expression you entered as a query parameter produced this error: MyDatabaseName can't find the name 'Enter Passcode1' you entered in the expression." when the DCount function executes.
If I replace the Parameters in the query with simple text, all works OK. (NB.Query does work 'on its own' with the parameter).
Any ideas?
Thanks.
If DCount("[PassCodeResult]", "[PassCodeQuery]",[PassCodeResult]="Fail") > 0 Then ....etc
PassCodeQuery's SQL is :
SELECT [Enter Passcode1] AS PassCodeResult
FROM Table1;
Works fine, but my query needs to contain parameters eg [Enter Passcode1]. When I include a Parameter in the underlying query, I get a message saying ...
"The expression you entered as a query parameter produced this error: MyDatabaseName can't find the name 'Enter Passcode1' you entered in the expression." when the DCount function executes.
If I replace the Parameters in the query with simple text, all works OK. (NB.Query does work 'on its own' with the parameter).
Any ideas?
Thanks.