>I have a situation where multiple instances of a form are activated.
>A public variable is used to hold the current filter value on a free table.
>When one of the instances of the form is closed it releases the public variable.
>Another instance of the form then encounters an error where the public variable
> is not found.
>I am not up as well as I should be on my macro substitution.
>Would someone out there please show me the proper way to handle this case.
>
Add new property to your form and keep filter variable in this property instead of global variable. Don't use variable or property in the filter expression. Use it's value as shown below.
lcFilterExpr = [somefield = "] + ThisForm.cFilter + ["]
SET FILTER TO &lcFilterExpr
--sb--