Repeat Statement

supp85supp85 Member Posts: 76
Hello,

I have a report which lists items detailing qty on sales orders and qty on purchase orders etc. all items have a Type which i have added as a data item and put in code to count all item lines by type using the following code:

Count := 0;

IF Item.FINDFIRST THEN
REPEAT
IF (Item.Type <> '') AND (Item.Type = Code) THEN
Count := Count +1
UNTIL Item.NEXT = 0;

This works fine and shows the correct total however i need to show totals for the other fields (Qty. on Sales Order etc) by type and have used the following code but is not working:

IF Item.FINDFIRST THEN
REPEAT
TotalQtySO := TotalQtySO + Item."Qty. on Sales Order";
UNTIL Item.NEXT = 0;

Any ideas or should this be done in a different way (Createtotals)?

Comments

Sign In or Register to comment.