| Gerald Lightsey 2006-10-25, 7:23 am |
| On Tue, 19 Sep 2006 20:37:55 -0500, in the dbase.getting-started group,
Forrest Ganther said...
> I want to use a variable as the filter criteria,
> but I can't figure out how. Even Ken's book
> doesn't address that. Is it possible?
>
> If not how can I work around?
What follows is from on-line help for SET FILTER. Keep in mind that
macro substitution itself requires a private or public variable so
fundamentally scope is the issue.
Gerald
Note
You cannot use the special variables this or form in the <condition>.
This is explicitly prohibited because these special variables
automatically take on the value of whatever object and form has focus
(or fires an event) at any given moment. Therefore, the filter condition
will vary and quite likely be invalid. Generally speaking, you should
not use variables in a filter condition at all, because the variables
may go out of scope, making the filter condition an invalid expression.
To solve these problems, use macro substitution, as shown in the
example.
|