*-- If this is a lower case letter IF BETWEEN(nKeyCode,ASC("a"),ASC("z")) *-- If it is the first letter or a letter after a space IF this.SelStart=0 OR (this.SelStart>0 and SUBSTR(this.Value,this.SelStart,1)=" ") *-- Uppercase the letter NODEFAULT RETURN DoDefault(nKeyCode-32,nShiftAltCtrl) ENDIF ENDIF *-- If this is an upper case letter IF BETWEEN(nKeyCode,ASC("A"),ASC("Z")) *-- If it is the not the first letter or a letter after a space IF !(this.SelStart=0 AND (this.SelStart>0 and SUBSTR(this.Value,this.SelStart,1)=" ")) *-- Lowercase the letter NODEFAULT RETURN DoDefault(nKeyCode+32,nShiftAltCtrl) ENDIF ENDIF>I think because it's resetting the "SelStart" value.