Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF statements going to first record in table
Message
From
09/11/1998 16:33:19
Bill Gravell
Indoor Purification System
Menifee, California, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00155216
Message ID:
00155931
Views:
20
>Hi all,
>
>We have a function button which does the following command in our app:
>
>do printrec
>
>We have been trying to implement a procedure using IF statements which will print a certain report based on field criteria. For example, IF field="x", print a certain report. This works for one IF statement at a time. We have a function button which does this - when the user is on the record, you just press this button and it prints the record with the report.
>
>However, the user has been trying to do this with a lot of IF statements strung together, like so:
>
>IF field='X'
>do printrec with "F", "PA"
>endif
>
>IF field='Y'
>do printrec with "F", "PB"
>endif
>
>etc.
>
>What happens is that it will print the selected report for the current record, but then it will to print the report for the first record in the table, then do it again. We only want it to print the report for the current record.
>
>Are there some other commands I need to insert in the procedure which will stop it from going back to the first record?
>
>Thanks for any and all help!
>
>Dave D'Amico
>ddamico@fmsystems.com

The asnwer of "REPORT FORM myrpt NEXT 1" is right on... the only other suggestion might be to use a do case structure instead of a series of if..endif, if there can be only one true statement. Can both field="X" and field="Y" both be true?

Bill
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform