FIXED: the variable in a query expression was not getting picked up if it was a form parameter.