Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thats Funny in a Combo!
Message
From
19/01/2000 00:41:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Thats Funny in a Combo!
Miscellaneous
Thread ID:
00319711
Message ID:
00319711
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform