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 12:53:47
 
 
To
30/06/2003 08:25:24
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00805151
Message ID:
00805371
Views:
25
>Maybe, but the SQL Engine which is what you are calling to compile the query isn't! >That's the root of the problem.

Andy and Dave, correct me if I'm getting confused, but the bottom line seems to be that THISFORM doesn't work in SQL queries. Yet, the code below (taken from a production application) runs fine:

SELECT DISTINCT ;
" " + (RTRIM(routeseg.route)+" "+IIF(EMPTY(routeseg.rte_spur),' 00',;
RTRIM(routeseg.rte_spur))+" "+IIF(EMPTY(routeseg.seg_origin),' 0.00',;
STR(routeseg.seg_origin,6,2))+" - "+STR(routeseg.seg_term,6,2));
AS SEGMENTS, ;
routeseg.seg_origin, ;
routeseg.seg_term, ;
PADR(SetCodeVal("JURIS", ROUTESEG.JURIS, "JURIS", "JURISVAL"), 25) AS JURIS, ;
PADR(SetCodeVal("MNTRESP", ROUTESEG.MNTR, "MNTRESP", "MNTRESPVAL"), 25) AS MNTR ;
FROM routeseg ;
WHERE THISFORM.Facility_id = routeseg.fcility_id ;
ORDER BY seg_term, segments ;
INTO CURSOR segtemp

This code is wrapped in a form method. Sorry, if it appears as funky as it does in the UT editor. :)

Is there something different about the way this code this code runs when the combo is initializing? Is is possible when the code first runs at initialization that THISFORM.Combo.Value doesn't exist yet?

John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform