Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>cGroupCode = THISFORM.text1.VALUE
>SELECT * FROM client ; <
>WHERE group_code = cGroupCode ; <
>INTO CURSOR Mycursor <
** Shouldnt _TALLY go here?
>REPORT FORM POLICY.FRX FOR GROUP_CODE = cGroupCode PREVIEW
** Why the FOR GROUP_CODE here? You already found those records in Mycursor.
>This is asking for trouble - using a REPORT FORM based on a FOR in conjunction >with a PREVIEW may result in the filter not being applied if the user decides >to print. Either do a SELECT to a cursor, or use a P-view as the basis of the >report (if you inherit from the current DE and you need the detail to have the >name of the base table, you can always open the P-view with an ALIAS) so that >you don't run into this particular trap
>IF _TALLY !=0
> wait window 'FOUND MATCH, WILL PRINT REPORT '
>ELSE
> wait window 'NO DATA MATCH, TRY AGAIN '
>>>ENDIF
>
>RETURN
>Burp - the cursor MyCursor's FOR clause just became invalid, since cGroupCode >just went out of scope.
**What do you mean? The cursor is already made at this point isn't it?
**How does cGroupCode go out of scope?
>Try converting the SELECT to convert cGroupCode to a literal with macro->expansion and quote encapsulation as shown below:
>SELECT * FROM client ;
>WHERE group_code = [&cGroupCode] ;
>INTO CURSOR Mycursor
**I've never seen a literal with macro-expansion and quote encapsulation. Is this all really necessary?
Thanks. Just trying to follow along here.
BTW, can I carry over the text I'm replying to without having to cut and paste?
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