Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thisform can only be used within a method
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00325372
Message ID:
00325661
Views:
20
>Sorry, try putting the macro within quotes:
>
>lcvalue = THISFORM.Spinner1.Value
>set filter to somefield = "&lcvalue"
>

Mark, this works with strings, but not numbers. The real key here is to either set the filter to reference the spinner using a continuously-resolvable reference (IOW, rather than thisform, use whatever the current member of the _SCREEN.Forms collection is, so that when you move out of this object, the reference can still be resolved) or to insert a literal of the appropriate type in and use macroexpansion to set up and resolve the filter value; this has the problem that you have to completely reset the filter whenever the value is altered.

A better approach might be to use a parameterized view; whenever the vlaue chaged, update the parameter variable and requery. Since this is not tied tightly to the control, you're fine as long as you reset the variable and requery the view whenever this value changes. this gets around all the problems of mcroexpansion pretty well, and gets away from one of the constructs that I try to avoid, SET FILTER.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform