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
 

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