Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET FILTER error
Message
From
11/04/2000 20:01:51
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00358422
Message ID:
00358440
Views:
17
Hi John,

The reason that it falls over is because the variable scoping for VALUE2 has disappeared once the VALID has executed ( I'm assuming that VALUE2 is a variable defined as LOCAL in the VALID), so each time the FILTER is evaluated it's looking for VALUE2 which no longer exists.

I get around this problem by doing something like

cCommand = "SET FILTER TO field1 = " + value1 + " AND field2 = " + value2
&cCommand

Hope this helps.

Gavin...

>In VFP5, in the command window, I could type:
>
>SET FILTER TO field1=value1 AND field2=value2
>
>and the filter works as it should. However, if I put the same code in Valid method of a textbox on a form I get an error:
>
>"Variable value2 not found". The variable does exist 'cause I set this just prior to the SET FILTER command. Is this a bug or something? It only works if I SET FILTER TO only one condition.
>
>I don't use SET FILTER very often (if at all) but for this instance but it should work nonetheless. Pretty weird.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform