>In a ComboBox I have the same field as a ControlSource and as a RowSource. Is there a way I could edit the visible content of the combobox. I would like to change a value in the table using the textbox part of a combobox.
>Thank you.
Hi,
Try this after subclassing a combobox and adding the appropriate props, methods.
*Extra properties
Aliasname && Rowsource alias
Fieldname && Rowsource fieldname
*Init
This.rowsourcetype = 3
This.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 ]
*When
THIS.REQUERY
*Lostfocus
Do While occurs(" ",this.displayvalue) > 0
this.displayvalue = strtran(this.displayvalue," "," ")
Enddo
This.displayvalue = Upper(Chrtran(Alltrim(This.displayvalue),"ýi","IÝ")) && This is just for special language handling - u can remove it
this.value = this.displayvalue
Cetin