Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why 'Thisform can only be used in method' error?
Message
 
 
À
30/06/2003 08:25:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00805151
Message ID:
00805371
Vues:
24
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform