Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box
Message
From
03/08/2001 13:59:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/08/2001 13:51:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00539518
Message ID:
00539530
Views:
11
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>This might be an easy one. I have a combo box on a form. The RowSourceType is set to SQL statement. The SQL statement is something like 'select * from sometable into mycursor' The resulting cursor has two fields for each record. Field1 is the primary key, field2 is a description. Is there a way I can have the combobox.value=field1, but the text displayed when you click the combobox to be from field2? Right now I have the columncount = 2 so you see both. But I would like the users to be only be able to see the description as the key means nothing to them. (but i need it for other code on the form)
>
>Thanks,
>Chris

Chris,
Put your display field (field2) in front. Something like this :

.RowsourceType = 3
.Rowsource = 'select field2, field1 from myTbale into cursor crsCombo'
.Columncount = 2
.BoundColumn = 2
.ColumnWidths = '100,0' && 2nd never displayed
.ControlSource = 'sometable.somefield'

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