*** handle the key...IOW, find the closest match in the list IF This.SelStart > 0 IF ( LASTKEY() > 31 AND LASTKEY() < 128 ) OR ( LASTKEY() = 7 ) This.HandleKey() ENDIF ENDIFHandleKey method:
LOCAL lcSofar, lnSelStart, lnSelLength, lnRow
WITH This
*** Handle backspace key
IF LASTKEY() = 127
.SelStart = .SelStart - 1
ENDIF
*** Get the value typed in so far
lnSelStart = .SelStart
lcSofar = LEFT( .DisplayValue, lnSelStart )
*** Find a match in column #1 of the combo's internal list
FOR lnRow = 1 TO .ListCount
IF UPPER( .List[ lnRow, 1 ] ) = UPPER( lcSoFar )
.ListIndex = lnRow
EXIT
ENDIF
ENDFOR
*** Highlight the portion of the value after the insertion point
.SelStart = lnSelStart
lnSelLength = LEN( ALLTRIM( .DisplayValue ) ) - lnSelStart
IF lnSelLength > 0
.SelLength = lnSelLength
ENDIF
ENDWITH
Keep in mind that his is a combo class with style=0-DropDown Combo. There is also code in the GotFocus() to ensure that the entire value is selected even when the user clicks in the combo.