fieldname = "none" aliasname = "none" WITH This .sellength=12 .rowsourcetype = 3 if lower(fieldname)="none" or ; lower(aliasname)="none" fieldname = substr(.controlsource,rat(".",.controlsource)+1) aliasname = substr(.controlsource,1,rat(".",.controlsource)-1) endif .rowsource = [SELECT DISTINCT ]+fieldname+; [ AS dummy FROM ]+aliasname+[ where !empty(]+fieldname+ ; [) union ] +; [SELECT this.displayvalue as dummy ]+; [ FROM ]+aliasname+; [ INTO cursor q_hardware ORDER BY 1 ] ENDWITH WAIT WINDOW "Query is initialized" <\PRE> In the interactive change procedure *This.displayvalue = Upper(Chrtran(Alltrim(This.displayvalue),"yi","IY")) && Local language fix <PRE> With This if .selstart = 0 return endif cPos = .selstart if lastkey() = 127 && Backspace if .selstart = 1 .displayvalue = "" .selstart = 0 .sellength = 0 return endif cCheckValue = left(.displayvalue,.selstart-1) cPos = cPos - 1 else cCheckValue = iif(cPos = 1,"",left(.displayvalue,cPos-1))+chr(lastkey()) endif lExistsOne = .f. for ix = 1 to .listcount if Upper(Alltrim(.list(ix))) = upper(alltrim(cCheckValue)) .displayvalue = .list(ix) lExistsOne = .t. exit endif endfor .selstart = cPos if lExistsOne && Available item .sellength = len(.displayvalue) - cPos *** else *** .sellength = 0 endif endwithIn the lost focus procedure
this.value = this.displayvalue this.displayvalue = this.value In the when procedure This.REQUERY