Bernard,
Yep, it's
By DesignSet 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.