Passing A Variable As Query Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 ;-)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top