Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thisform Gotchas! Wow!
Message
 
To
06/12/2000 22:32:12
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00450216
Message ID:
00450706
Views:
29
David,

First, Thisform is a relative reference to a fomr object that only has meaning in code that is "IN" the form. Your UDF is NOT IN the form so the Thisform means nothing in your UDF. When your UDF is running the filter cannot see THISFORM. Using Thisformin a filter is an invitation to the very error you report.

Instaed put the value of ther propety into the filter directly using a macro or an evaluate() as below;
lcValue = Thisform.Property
SET FILTER TO Filed = EVALUATE(lcValue)
This way the filter is not depentand on either the Thisform being relavant nor the variable lcValue being in scope.

As for the COUNT, there are a number of fox commands that don't respect the WITH stuff, LOCATE for example.

As for the modal form you refered to, well when the COUNT runs the fil;ter needs to be evaluated and the filter is being evaluated in the modal fomr so Thisform refers to that one then. See above to fix that.
Previous
Reply
Map
View

Click here to load this message in the networking platform