I am getting an error on a stored query that accepts parameters from a form.
I am currently testing the query by entering the parameters manually. I enter a date for [Forms]![Scan].[txtScanDate] and then the value "2" for [Forms]![Scan].[txtScanNo].
Executing the query causes the following error:
"The expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."
The query will work without the parameters and the WHERE clause. Does anyone know what is causing the error?
Thanks
Code:
PARAMETERS [Forms]![Scan].[txtScanDate] DateTime, [Forms]![Scan].[txtScanNo] Integer;
SELECT [BoxScans].[Barcode], [BoxScans].[ScanDate], [BoxScans].[ScanNo], Sum( [BoxScans].[Quantity]) AS Total
FROM BoxScans
WHERE ([BoxScans].[ScanDate]=[Forms]![Scan].[txtScanDate] And [BoxScans].[ScanNo]=[Forms]![Scan].[txtScanNo])
GROUP BY [BoxScans].[ScanDate], [BoxScans].[ScanNo], [BoxScans].[Barcode];
I am currently testing the query by entering the parameters manually. I enter a date for [Forms]![Scan].[txtScanDate] and then the value "2" for [Forms]![Scan].[txtScanNo].
Executing the query causes the following error:
"The expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."
The query will work without the parameters and the WHERE clause. Does anyone know what is causing the error?
Thanks