Query criteria a variable

  • Thread starter Thread starter kon
  • Start date Start date
K

kon

How can I use in a query in design view in criteria a variable (A variable
used in VBA code)?
 
Create a public function (in a regular module) that reads the value of the
variable -- note that the variable must be a global variable:

Public Function GetMyVariable()
GetMyVariable = NameOfTheVariable
End Function

Then call the function in your query using GetMyVariable().
 

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