Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you add to a COMBO BOX?
Message
From
31/10/1997 21:14:28
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00057406
Message ID:
00057714
Views:
37
>>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

thanks again Jim, -- this code will help me a lot....
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Reply
Map
View

Click here to load this message in the networking platform