Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set filter with combobox
Message
 
To
21/08/2001 12:57:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00546844
Message ID:
00546862
Views:
24
>Hello all
>
>i'v the following problem,
>
>i want to filter my grid upon a selection in a combo box
>so i tried :
>
>in combobox's click event:
>set filter to tablefield = this.value
>
>also tried to put this in valid event
>
>but in both cases i get the errormessage:
>"THIS can only be called from a method"
>
>thx
>
Christian,

I'd suggest populating the grid on-the-fly from from a query based on the combo box selection rather than a filter. One reason for this would be to avoid scoping problems and errors that will occur as a result. For example, open up a table, then create a new program file. Put the following, replacing "somefield" and "somevalue" as appropriate, in the new program file, highlight it and exectute
LOCAL lcvalue
lcvalue = somevalue
SET FILTER TO somefield = lcvalue
Now go to the command window and issue a BROWSE.

You'll get the error message that 'Variable "LCVALUE" is not found'
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform