Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo won't show value in table
Message
De
11/08/1997 13:37:10
 
 
À
11/08/1997 13:18:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00043996
Message ID:
00044029
Vues:
37
>>>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
>>
>>Use DisplayValue property (fire this code from form refresh utility):
>>Thisform.Combo1.DisplayValue=table1.colorfield && might be "sky blue"
>
>Edward, it seemed to me that that should work, but it doesn't. In fact, it replaces the value in the table with an empty string. Can you think of what I might be doing wrong?
>
>Thanks,
>Ross

It might be helpful not to use Combo.Controlsource property (clean it to none). After this it must work, at least it will not replace field value with empty string because such 'replacement' will be handled completely in code.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform