Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thats Funny in a Combo!
Message
 
To
19/01/2000 00:41:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00319711
Message ID:
00319714
Views:
13
Bernard,

Yep, it's By Design

Set the combo's BoundTo property to .T.. This causes the combo to use the value of the bound column, not the listindex if the control source is numeric.

Cheers,

Andrew

>The other day I tried the following on a form.
>
>Added a combo box, ran the builder and selected 2 fields from a table to display, the first a Chr field and the second a Numeric(id) field. The idea was to present a serchable drop down list and display the Chr field. When the user selected this field the ID from the second field was to be used and stored in a variable gnClientId, which was initialised to 0 at startup. This was done in the builder.
>
>But on running the form, instead of the id being stored, the ListIndex of the combo box was being stored.For eg.if the list looked like this:
>
>ClientName1 21
>ClientName2 34
>ClientName3 22
>
>etc. (sorted on ClientName)
>
>and If I selected ClientName2, the value property (ThisForm.CmbClient.Value) = 2, gnClientId = 2 and not 34 although it was specified in the builder to return a value from the second field.
>
>Now If I initialised gnClientId to a string - gnClientId = "" and then ran the form, the Id WAS returned correctly - but as a string!
>
>If I selected ClientName2, the value property (ThisForm.CmbClient.Value) = " 34", gnClientId = " 34"
>
>Help. Is this by "Design"?
>
>Bernard


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Previous
Reply
Map
View

Click here to load this message in the networking platform