Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help me understand dropdown combo's
Message
From
09/04/1998 09:06:46
 
 
To
08/04/1998 17:21:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00090213
Message ID:
00090733
Views:
17
>>>I have never really gotten a dropdown combo to work correctly when the user enters something other than selecting what's in the list. I have a dropdown comboa with .controlsource=Job_Info.Quoted_By and it is populated by a comma delimited list of employee names, but I want to be able to enter something not in the list. When you enter you own text, it doesn't appear in the list, and I can't get it to save the info to the table.
>>>
>>>Please help.
>>
>>When you enter something into text portion of combo you actually populate Combo.DisplayValue property. The next step you have to add (if you want) this entry to the list portion (rowsource) programmatically, e.g.
>>
>>***Combo.Lostfocus event
>>if this.displayvalue<>this.value
>> Insert into table1 Values(...)   && table1 is rowsource
>> This.requery
>>endif
>>
>
>
>Well, I don't really want to add the entered text to the .rowsource (which is an array), I just want to store it into the .controlsource of the combo box (which is a feild from a free table), and have it display the user-entered text in the textbox area, even when the combo box loses focus. It seems that since the combobox cannot find a match between the entered text and the .rowsource items, that it doesn't display it, and it doesn't udpate the field in the table.

That's not a problem if you will utilize unbound combo, i.e. Combo.Controlsource="". Now, you can populate table.field in Combo.Lostfocus event Replace table.field with this.displayvalue, also you should add code Combo.Displayvalue=table.field in Form.Refresh routine.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform