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