Using NODEFAULT in the LostFocus() should work. However, is there a reason why you couldn't put the code in the Valid() method and simply return .F. or 0? Either one will simply return the cursor to the field so the user can reenter the data.
>What I did is if invalid information was entered I used the nodefault command and that seemed to work. I had the code in the valid event and it worked there too, but Setfocus was called later in the program and we kept getting errors because you can't call setfocus from a valid event, for what ever reason . . .
>
>Thanks for the help,
>
>Jim Rieck
>
>>Jim, Since you cannot setfocus() in the valid or the lostfocus event, I have called the click of another object from the valid or lostfocus and had that click setfocus(), I know this is probably not very clean, but it works.
>>Hope this helps
>>James