>Hi,all
> I have used a cursor or array into combo box to display datas.Although the cursor has records and rowsource has been matched the name of the cursor,but it
>can not be displayed into the combo box.Why?? Please tell me.
>
>Please check it!!!
>
>With Thisform.combobox1
>*.RowSource = " "
>.RowSourceType = 1
>.RowSource = "Select FIELD NAME from TABLE NAME where FIELD NAME = VALUE into cursor Mycursor"
>Endwith
>
>Is it right ??
Linda,
When rowsource is an SQL like in your sample then set rowsourcetype to 3 - SQL.
Taking testdata.dbc tables as sample data :
With Thisform.combobox1
.RowSourceType = 3
.RowSource = 'select prod_name, product_Id from products '+;
' where !discontinu '+;
' order by prod_Name '+;
' into cursor crsProds'
.ColumnCount = 1
endwith
Columncount = 1 is sufficient assuming you only want to show product's name. At anytime you can get product_id by saying :
crsProds.Product_Id
Cetin