>hi cetin
>oops, i tried that too but no success. btw how do i default the 2nd combobox to column2, pls? ta
Sn,
I think you mean boundcolumn. Boundcolumn=2. If you mean displayvalue then place what would be displayed as first column and adjust columnwidths.
With this
.RowSourceType = 3
.RowSource = 'select cust_id, company from customer into cursor crs1'
.Columnwidths='100,100'
.Columncount=2
.BoundColumn=1
Endwith
With this
.RowSourceType = 3
.RowSource = 'select company,cust_id from customer into cursor crs2'
.Columnwidths='100,100'
.Columncount=2
.BoundColumn=2
Endwith
=seek(this.value,'customer','cust_id')
thisform.combo2.listindex = this.listindex
thisform.refresh
select customer
30
store customer.cust_id to ;
ThisForm.Combo1.Value,;
ThisForm.Combo2.Value
With rowsourcetype set to something using cursor\table (like Fields,alias,SQL) bear in mind that record pointer moves as selection changes. IOW this is fairly legal (and which I prefer instead of depending on boundcolumn, value, list, listindex etc - and more flexible than using long obj refs):
With this
.RowSourceType = 3
.RowSource = 'select * from customer into cursor crs1'
.Columncount=2
.Columnwidths='100,100'
Endwith
lcCust_id = crs1.cust_id
lcCountry = crs1.country
Cetin