Article ID: 150752
Article Last Modified on 7/13/2004
IF MCOL(THISFORM.name)>=THISFORM.command1.left AND ;
MCOL(THISFORM.name)<=THISFORM.command1.left + ;
THISFORM.command1.width AND ;
MROW(THISFORM.name)>=THISFORM.command1.top AND ;
MROW(THISFORM.name)<=THISFORM.command1.top + ;
THISFORM.command1.height AND ;
LASTKEY()<>9 AND LASTKEY()<>13
RETURN .t.
ELSE && The next IF changes the Lastkey value to something
* other than Tab or Enter, which is part of the workaround.
IF LASTKEY()=9 OR LASTKEY()=13
KEYBOARD "{RIGHTARROW}"
KEYBOARD "{LEFTARROW}"
ENDIF
* The next IF is an example of a validation code.
* You can replace this example with your own validation code.
IF EMPTY(THIS.value)
RETURN .f.
ENDIF && End of validation example.
ENDIF
Keywords: kbhowto KB150752