Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo won't show value in table
Message
From
13/08/1997 16:21:24
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00043996
Message ID:
00044546
Views:
28
>>I am having trouble getting a combo box to show the values in a table field. Here is the behavior I want: the user should be able to enter any text value into the field, or should be able to choose from a list of values that occur frequently. For example, the combo box items might be common colors such as red, blue, etc, but if the user wants the data to be "sky blue" he can type that in.
>>
>>I have the rowsource set to a small table with the common values, and the control source set to the table field for the data. My problem is in displaying the value in the combo. If one user types in "sky blue", that value is saved but it doesn't show on another user's form because "sky blue" is not a record in the combo's row source. I do not want to add "sky blue" to the rowsource table.
>>
>>How does one get the combo box to display values that aren't in its rowsource but are in its controlsource?
>>
>>Thanks,
>>Ross
>Ross,
>
>You can populate the combo from the table in its Init by using the Addlitsitem method so the combo's lsit is independent from the table. Then in the combo's refresh you can check to see if the field value is in the list, if not add it with AddListItem mehtod and that item will now be in the list but not in the lookup table.

Thanks Jim, I'll try that. Barbara, I got the same results using arrays or tables. I haven't tried AddListItem yet but it looks promising.
Previous
Reply
Map
View

Click here to load this message in the networking platform