Claudio, this last change should not make a difference because FoxPro evaluates the expression following 'TO' only once, not every step of the for loop.
>oops... another one... instead of:
>
>
>FOR lni = 1 TO .oRS1.RecordCount
>
>
>try
>
>
>local lnRecordCount
>lnRecordCount = .oRS1.RecordCount
>
>FOR lni = 1 TO lnRecordCount
>
>
>Doing like this, instead of reading the RecordCount property in every single iteration of the loop (what has the COM overhead), you just read it once, and then just read a memvar in the iteration. That might help.