FUNCTION handelkey(toTxtObject) LOCAL llRet , loTxtObj, laEvent[1], lnSelStart, lcSofar, lnSelLength, llSeekSuccess, lnWait IF VARTYPE(toTxtObject)="O" loTxtObj = toTxtObject ELSE AEVENTS(laEvent,0) IF VARTYPE(laEvent[1]) = "O" loTxtObj = laEvent[1] ELSE RETURN .f. ENDIF ENDIF WITH loTxtObj llSeekSuccess = .f. lnSelStart = 0 *// DEBUGOUT LASTKEY() IF INLIST(LASTKEY(),96,126) =INKEY() llSeekSuccess = this.displaylist(loTxtObj) ELSE lnWait = INKEY(_incseek) *** Handle backspace key IF LASTKEY() = 127 AND .SelStart > 0 .SelStart = .SelStart - 1 ENDIF *** Get the value typed in so far lnSelStart = .SelStart lcSofar = LEFT( .Value, lnSelStart ) *// DEBUGOUT lcSofar IF lnWait = 0 llSeekSuccess = this.seekvalue(lcSofar) ELSE KEYBOARD (CHR(lnWait)) llSeekSuccess = .f. ENDIF ENDIF IF llSeekSuccess .Value = EVALUATE(this.csearchcursor+"."+this.csearchcolumn) this.lseekfailure = .f. ELSE this.lseekfailure = .t. ENDIF *** Highlight the portion of the value after the insertion point .SelStart = lnSelStart lnSelLength = LEN( ALLTRIM( .Value ) ) - lnSelStart *// DEBUGOUT .SelStart, lnSelLength IF lnSelLength > 0 .SelLength = lnSelLength ENDIF RETURN llSeekSuccess ENDWITH ENDFUNC>I have a form that has a textbox used for a search function. Currently, as the user keys information into the search box (tSearch), a KeyPress and Interactive change method controls processing. Certain function keys, such as left arrow, right arrow, enter, etc are processed specifically by the KeyPress method. The interactive change causes a rather large FILTER statement to display specific records in a grid elsewhere on the page based on the string entered in tSearch.