Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Cursor or array into a combo box
Message
From
28/01/2002 03:37:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/01/2002 03:11:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00611387
Message ID:
00611390
Views:
17
>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 :
*SQL rowsource
With Thisform.combobox1
  .RowSourceType = 3 && SQL
  .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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform