Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you add to a COMBO BOX?
Message
 
À
30/10/1997 12:09:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00057406
Message ID:
00057544
Vues:
43
>Hi Jim,
>rowsourcetype is a field. When I APPEND BLANK, I am getting blank records
>in the table. The value I enter in the combos are not moving to the fields.
>Some how they are blanking out. I have setup a test form with only
>and add button and a combo on it. any ideas? :)
Robert,

A combobox is not a data entry control likje a text box. It is a list limited selection control. If you make it style dropdowncombo then it will accept a typed in entry that does not appear in its list, but that does not add that value to the list. In this case the displayvalue and the value properties will not be equal to each other.

If you want a combo that automatically adds entered values to its list you have to code it to do that. In this case you MIGHT choose to use the combos valid evetn to sense that displayvalue is not equal to value adn thenadd a record to the table that the list is based on with the field in the list being populated by the display value of the combo as in;

* Combo's valid
IF THIS.DisplayValue <> THIS.Value
* The user has typed a value that is not in the list
INSERT INTO (KeyField) VALUES (THIS.DisplayValue)
THIS.Requery()
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform