Thanks heaps for the response. We are processing a csv file. I will give it a go. My concern is that I need to compare the order number half way through the loop. I dont want to go back to the very beginning. It is when I get to variable T4 that I need to compare T3 with the new line before it is processed.
My situation is that I am loading up information against an order number. This can have a few items in it. So currently I am doing a record for each order number and each item. So that for a customer we could have 7 individual printouts where I would like to have only 1.
So to enable me to do this, I need to set if the next line in the csv file is the same order number as the one I am currently processing. If it is then I need to add another item. If it is not, then continue and create a new record.
Hope this makes sense. Will your suggestion cater for that?
Regards
Vera