Set a breakpoint on RECNO("Work") just before it starts the SCAN. The program will break when RECNO() changes and you'll find where it's happening.
>Yes, both tables are ordered. I was doig a SEEK() command with an IF condition.
>
>Here's partial code:
>
>As soon as I SELECT the BATCHN table, the record in the WORK table returns to the record it had been on, although I specifically saw that it was on the second record on the second pass (loop).
>
>
>WITH ThisForm
> SELECT WORK
> SCAN
> SELECT BatchN
> lcOrderNo =Work.Order_Num
> lcPart_Num=Work.Part_Num
>
> *SELECT BATCHN
> IF !SEEK(lcOrderNo)
> * If there is no record yet, make a new one.
> APPEND BLANK
> * Put in the data for the first line item.
>
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer