Passing A Variable As Query Criteria

R

Robert_DubYa

First I must apologize for my ignorance on this. I am wondering if it is
possible to pass a variable to be used as criteria in a query. If so, how?

Thanks in advance,
Robert
 
T

TomHinkle

I found that it's easier to set up a table to make 'variables' in and Access
db.. Have a field called "VariableName" then a field for the value.
you can join those to a query pretty easily.


.... hope that dubya doesn't stand for what I think it does ;-)
 
O

Ofer

You can create a Function that return the value of the variable, and use this
function in the query

Global VarName as Double

Function FunctionName () as Double
FunctionName = VarName
End Function

Both, function and variable should be defined in a module, and not in a form
or report
 
Top