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

Signature
Ken Snell
<MS ACCESS MVP>
> How can I use in a query in design view in criteria a variable (A variable
> used in VBA code)?