Nadya,
Well, I was going to suggest adding "and !plStop" to the FOR clause, but I think REPLACE would still continue reading records to determine if changes should be made...
Is hitting the key actually triggering plStop to change values while the replace statment is in the middle of executing?
>
>I want to be able to stop the process.
>
>So, I have something like this
>ON ESCAPE plStop = messagebox('Are you sure you want to stop replace process?,36,'Stop process')=6
>
>So, user can hit ESC and the process would be stopped.
>
>That's the idea, and it similar to Sergey's SCAN solution, but SCAN is slower than one replace command.
>
>However, WHILE clause always makes the process to start from the current record, and I was not aware of it (or didn't realize it). So, in order to fix the problem my colleague put GO TOP at the top on the command button Click method. Unfortunately, there are multiple replaces under certain conditions, so this is still a partial solution...
Steve Gibson