Thanks everyone for your help. I have got it to work. with the following code:
LOCAL llok, lctext, lnReturn
lctext = ALLTRIM(THIS.VALUE)
IF !EMPTY(lctext)
THISFORM.moverlists1.lstSelected.ADDITEM(lctext)
THISFORM.ltextbox = .T.
ELSE
THISFORM.ltextbox = .F.
ENDIF
THIS.VALUE = ""
IF THISFORM.ltextbox = .T.
THISFORM.textbox1.SETFOCUS()
NODEFAULT
RETURN
ENDIF
THISFORM.REFRESH()
Such a simple answer, that could not be seen by me, until talking with you and my co-worker.
Beth
>As Sergey is suggesting you need more control over the reaction to user input. That suggests you need to take over the keyboard handler for the control. Instead of playing around with lostfocus and gotfocus look at the keypress event. Setup a case structure to evaluate input and make the decisions you need: update the value, exit the control, stay in the control, clear the value, etc. Even though it is character by character evaluation it is very fast and the user will not see any difference.
>
>Steve
>
>>>Can you explain what you're trying to do?