General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only