Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controlsource of combo
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00034532
Message ID:
00034546
Vues:
45
>>>I have a combo, .Style = 0-dropdown combo, .RowSourceType = 1-Value, Rowsource = TBD,N/A,VARIOUS, ControlSource = mytable.myfield. I thought that .Style = 0 meant that I could enter anything in the control, but it's not showing what I type, unless I select or type one of the three values in Rowsource. Since, for testing purposes, I have left in an old textbox with the same controlsource, I can see that values other than these three are not being saved to the table. What's going on?
>>
>>I guess, the problem originated from ControlSource. Personally, I don't use this property at all. Basically, combo will work this way:
>>Combo.Lostfocus event:
>>if this.dispalyvaluethis.value
>>This.additem(this.displayvalue)
>>endif
>>Use Value property when you "Save" the record to fill appropriate field.
>
>I wasn't sure what "if this.dispalyvaluethis.value" meant.

Yes, I just forgot that this is HTML and missed the symbol. Sorry, about this.

Perhaps "if this.displayvalue # this.value". I didn't want to add items to my combobox, and I wasn't sure how .displayvalue was used here. My combo has only one column. I did try removing the .ControlSource and putting a REPLACE myfield WITH THISFORM.combo.Value. Now my typed value remains visible in the combo, but is still not added to the table.

If you want to use existing items only, then set Style=2. If you want to type something else, you must add items to RowSource.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform