Hello,
Most of our tables have integer column as primary key and often we use combobox to select a row. We also store selected row id in form's property to use it later. Nothing unusual...
And here is the bug:
- combobox is based on alias (RowSourceType=2)
- combobox is bound to numeric column (BoundTo=.T. and BoundColum=some_numeric_column)
- combobox' ControlSource is set to ThisForm.SomeProperty (this prop is also numeric)
there is no way to select an item and see the selection in textbox portion of a combo.
There is some workarounds, but it requires additional code and the bug/behaviour is annoying. Could anyone confirm it?
Here is short prog, so you can try it by yourselves if you wish...
create cursor customers (name c(20), id i)
insert into customers values ('Company One',11)
insert into customers values ('Company Two',12)
insert into customers values ('Company Three',13)
insert into customers values ('Company Four',14)
insert into customers values ('Company Five',15)
frm = createobject('form')
frm.addproperty('companyid',0)
frm.addobject('cbo','combobox')
with frm.cbo
.top = 100
.left = 100
.rowsourcetype = 2
.rowsource = 'customers'
.boundcolumn = 2
.boundto = .t.
.controlsource = 'ThisForm.companyid'
.visible = .t.
endwith
messagebox('try to select a customer from a combo!')
frm.show(1)
use in customers
Best,
Janusz Czudek
WORD Software
http://www.wordsoft.com.pl