In Clarion a variable has to be bound before it can be used in a query. I guess that the same applies here!
In an Embed at the start of the procedure after opening files, you could enter the following code:
BIND('VarName',VarName)
Then you can use the variable in a string expression or query.
Finally in an Embed at the end of the procedure after closing files, you could enter the following code:
UNBIND('VarName')