Can I use a Public Variable as Criteria in QueryDesign View?

  • Thread starter Thread starter WSF
  • Start date Start date
W

WSF

Access97
I've tried using a variable within [ ] brackets but it doesn't want to
happen.

Is it possible?

TIA
WSF
 
It takes a little trick... write a simple function that just returns the
public variable value, and use the function as your query criterion. For
instance, if your public variable is MyVar, then write a function like:

Function Get_MyVar()
Get_MyVar = MyVar
End Function

and in your query criteria line enter =Get_MyVar()

HTH,
Nikos
 
Back
Top