Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why 'Thisform can only be used in method' error?
Message
De
30/06/2003 15:04:52
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00805151
Message ID:
00805430
Vues:
21
Hi John,

We have a related problem. We have two remote views that are using the same THISFORM variables. The second SQL remote view displays the input parameter form whereas the first SQL remote view does not.

We are using VFP 7 SP1.


>>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
ramil
~~ learning to stand still
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform