I am opening a recordset based on a match of the BatchID field between a form and a query. It works fine until I add the Expr1 < 0 condition, with the error indicating I need to define a variable for Expr1. I suspect this might also be a syntax issue. Expr1 is a calculated value in the query. Here is the code. I can declare the variable if that is the issue, but I wanted to know if a modification to my recordset statement would also solve the problem. Thanks!
Code:
Set rs = CurDB.OpenRecordset("SELECT * from UnprocessedBatchNegativeQuantityOnHandQuery WHERE" & _
" BatchID =" & Me.BatchID And Expr1 < 0)