Jason
Thanks for your reply. Executing the DODEFAULT(0 after validation was a great idea but it didn't work ....... unitl I added DODEVENTS right after the DODEFAULT and that worked. (I also tried DOEVENTS in the scenario where DODEFAULT is executed before the validation but that failed)
Another problem emerges however. The DOEVENTS causes a delay of 1 or two seconds before the focus actually moves. That is, the focus returns to the original column, then moves to the right one. The behaviour is clearly visible to me (hence to the user). In the time where the focus is still in the original column, typing something causes an error. So I have reverted back to the KEYBOARD() solution. (The users are entering orders fast. As soon as the product number is entered, they are already typing in the quantity which is the next column).
You gave me a really good clue anyway. The behaviour caused using DOEVENTS is telling me something about what is happening but I am not sure what since pending events should be at a minimum at that moment.
Thanks again
>>>Have you tried keyboard idea, which Vlad also proposed?
>>
>>Yes. That is what I am doing now but if the user back tabs, the cursor will still go forwards.
>
>Try trapping instances in which you don't want the user to leave the control, and only then return a 0, which prevents leaving the control. Otherwise, RETURN the DODEFAULT value on the valid and lostfocus, which should allow the user to tab/backtab freely.