************************************************** *-- Class: cmbself_edit (c:\vfpclasses\global.vcx) *-- ParentClass: combobox *-- BaseClass: combobox * DEFINE CLASS cmbself_edit AS combobox Height = 22 Width = 100 DisabledBackColor = RGB(255,255,255) aliasname = "None" fieldname = "None" Name = "cmbself_edit" PROCEDURE When THIS.REQUERY ENDPROC PROCEDURE LostFocus This.displayvalue = Upper(Chrtran(Alltrim(This.displayvalue),"yi","IY")) && Local language fix this.value = this.displayvalue ENDPROC PROCEDURE Init WITH This .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 ]+THIS.fieldname +; [ as dummy FROM ]+this.aliasname+[ where !empty(]+THIS.fieldname + ; [) union ] +; [SELECT this.displayvalue as dummy ] +; [ FROM ]+this.aliasname + ; [ INTO cursor qq order by 1 ] ENDWITH ENDPROC ENDDEFINE * *-- EndDefine: cmbself_edit **************************************************With this class I generally set it to same controlsource as target field (w/o an extra lookup table - aliasname and fieldname are left as default). Test it if you have time (for now I'm about to leave).