Well, that seemed to fix it, but still does not explain why it worked for several days with no problems. It all ran well, then a whole series of problems cropped up, mostly with the data environment getting confused.
Thanks.
>I's most likely that problem lies in the getinarow() function code or it effect on UPDATE command. Try first to seprate the getinarow() function execution from UPDATE command.
FOR lnNum = 1 TO 50
> lnRepeats = getinarow(lnNum)
> UPDATE repeats SET repeated = lnRepeats where number = lnNum
>ENDFOR
Notice that FOR loop is equivalent of yours DO WHILE construction.