LOCAL lnCursorPos, lnSelLen DODEFAULT() DO CASE CASE < Some Condition > lnCursorPos = 1 CASE < Some Other Condition > lnCursorPos = 2 . . . OTHERWISE *** Position the cursor at the beginning of the value in the text box lnCursorPos = 0 ENDCASE WITH This lnSelLen = LEN( .Value ) - lnCursorPos .SelStart = lnCursorPos .SelLength = lnSelLen ENDWITH NODEFAULTYou need the DODEFAULT() and NODEFAULT here because the default behavior of the VFP in GotFocus is to reset SelStart and SelLength properties.