Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not understanding style=0 for ComboBox
Message
De
23/05/2007 18:36:37
 
 
À
23/05/2007 14:59:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01228009
Message ID:
01228091
Vues:
20
I do not want to keep the non-standard value for suqsequent entries.

I see to be half-way there. In LostFocus, I do
Replace BOB.Comments with This.DisplayValue
which saves the non-standard value into the control source.

However, when I bring up this record again, the combobox is blank (it is filled in correctly for values that match standard values). What do I do so that the non-standard text saved in my field is visible in the combobox?

Thanks

>It is up to you to either add non-standard value to the rowsource or not. It depends if you want to keep this non-standard value for subsequent entries. DisplayValue can be checked, for example, in Combobox.LostFocus event or when you save the record. There is one situation (combobox in grid) when you must save DisplayValue to the rowsource.
>
>>
>>A new item that needs to be saved? Are you saying that the new value gets added to the list of standard descriptions?
>>
>>If so, that's not what I want to achieve ... what I want is to have a list of about 10 standard descriptions, which is what is seen from the drop down. Else, the user can enter whatever they want.
>>
>>And where would I put the code to check that DisplayValue <> Value ???
>>
>>Thanks
>>
>>>>Howdy --
>>>>
>>>>I've got a combobox in which I'd like to give the user the ability to select from a brief list of standard descriptions (text), which are maintained in a free table, or to enter freeform any other text.
>>>>
>>>>The combobox has a recordsource which is a field in another free table.
>>>>
>>>>I think that using style=0 should do the trick. However, when the user enters text, rather then choosing a selection from the drop-down, the text disappears when exiting the field. Furthermore, if I manually put random text into the table, and then edit that record, the text disappears. Looks like it only wants values that are in the rowsource.
>>>>
>>>>What part of this have I been missing?
>>>>
>>>
>>>You have to have code that traps and saves thy new entry. Check whether Value=DisplayValue and, if not, you have a new item that needs to be saved.
>>>
>>>Tamar
Jim Nelson
Newbury Park, CA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform