Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic User Input to search and report
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00355661
Message ID:
00360652
Views:
19
>Hi John,
>
>It looks ok from here. I'm not sure what could be causing it.
>
>You may want to start a new thread in "Troublshooting" and see if some else has any ideas.
>
>>Hi Roi,
>>> I hate to keep beating a dead bird, but got a quick question. <
>>> I've got the folling code in my command button <

Where in the command button? The Click event?

>>> cGroupCode = THISFORM.text1.VALUE <
>>> SELECT * FROM client ; <
>>> WHERE group_code = cGroupCode ; <
>>> INTO CURSOR Mycursor <
>>> REPORT FORM POLICY.FRX FOR GROUP_CODE = cGroupCode PREVIEW <

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. 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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform