select mytable
lcvalue = This.Value
Set Filter to field = lcvalue
When you issue the above commands the filter expression looks like the following:
field = lcvalue
Whenever you access the table after that, FoxPro will evaluate lcvalue at that time and give you the records you want. However, if lcvalue was a local or private variable, it will most likely not be in scope when you attempt to evaluate it again so FoxPro throw an error (Variable lcvalue not found). It must evaluate the variable immediately.
One other thing. The above works well with date and numeric data types. I forgot, in my previous post, to surround the macro substitution in quotes if the filter condition is a character string.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao