>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement