Say you have a public variable called strSelection, then create a function in a standard module as follows:
Code:
Function GetSelectiona()
GetSelection=strSelection
End Function
Then, in your query, use GetSelection() in the criteria row for the field to be filtered
OR use GetSelection() as a field value according to what you need
Alternately you could just convert the query to sql and reference the variable that way or even use qry def to write the query if you needed to have the actual query for some reason.