Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why 'Thisform can only be used in method' error?
Message
From
30/06/2003 07:10:13
 
 
To
29/06/2003 21:40:59
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00805151
Message ID:
00805214
Views:
24
Hi Jim

>Doing so results in the error message "Thisform can only be used in method" and the question is WHY?
>
>I've found a way around but don't see why I had to lose an hour on something that looks like it shouldn't happen.

As David has already said, the actual execution of the SQL statement is not in the method code of the form.

You will get the same erro (for the same reason) with parameterized views that reference a form property for the parameter, and if you call a function, procedure or pop-up menu that refers to "thisform".

The solution is to transfer values from properties into variables in these situations, but then you must ensure that the variables are in scope when the query is compiled and executed. That means that such variables must be at least "Private" (so that they are available to the dependent function). Using Local variables in this particular scenario won't do.
----
Regards
Andy Kramek
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform