I have a textbox, whose value is initialized to 0, with the following in the VALID:
IF LASTKEY() = AscEsc
RETURN
ENDIF
lOK = .T.
DO CASE
CASE This.Value <= 0
WAIT WINDOW "Group size must be greater than zero"
RETURN .F.
...followed by other cases in the CASE statement.
According to the tab order, the text box is the first control in the form, and it IS selected when the form starts.
I don't want to let focus out of the text box until the user inputs a non-zero value. At times, once the form is diaplayed, and the user user clicks on a combo box on the form, the valid does not fire, i.e., the focus leaves the textbox and goes to the combo box. [If the user presses the TAB or ENTER key with the intial zero value, the appropriate error message is displayed.]
I'm missing something...how can I keep focus on the text box until the user has entered a legal value? Any input is appreciated. J