Kile,
Put the code in the LostFocus() not the keypress. Then add a NODEFAULT command (before the new SetFocus() command so VFP doesn't move to the next control in the Tab Order.
IF (correct item in listbox)
NODEFAULT
Thisform.Page.Pageframe.AppropriateContainer.cmdEdit.SetFocus()
ENDIF
HTH
Barbara
>SetFocus is messing with me...