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().
 
Back
Top