>Hi Terry,
>
>Here is the piece of code at the very end
>
>SELECT comision
> SET ORDER TO 1
> GOTO m.iRec
> WAIT WINDOW "Return to the " + TRANSFORM(m.iRec) + " Current Order is " + ORDER() nowait
>
> IF ccomish#0 AND Com_Rep.DATE<=m.Date2
>** Nadya Nosonovsky 11/29/06
> IF PAYMENT <> 0
> REPLACE NEXT 1 comision WITH m.ccomish, paid_date WITH m.mmD, ;
> rate WITH comision*100/PAYMENT
> ELSE
> REPLACE NEXT 1 comision WITH m.ccomish, paid_date WITH m.mmD, ;
> rate WITH 0
> ENDIF
> ENDIF
>ENDSCAN
>
>I added a check for Payment <>0 because I was getting numerical overflow error. In any case, it should not affect the scan loop. However, I'm getting an error on the ENDSCAN command and when I check iRec and recno in debug they don't match and order for comision table is empty, though wait window still shows right info.
>
>The only other problem with the replace I see, that it tries to update Rate field based on just updated Comision field.
>
>But why this should be relevant?
>
>I'm completely puzzled and don't know how to fix the problem... Why the order is being re-set for Comision table? There is no code to set it to nothing...
Glad you've got it sussed with the others so I won't bother reading. Just had to reboot half an hour ago and have only just come back "on air" :-)
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.