Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with ComboBox
Message
From
03/06/1999 16:20:38
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00226181
Message ID:
00226224
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Edward,
>
>>> Let me describe my problem:
>>>
>>> I have a table with Keystring - Unique field, Substitute - not Unique field (could be blank also). Other fields don't matter.
>>>
>>> I want to achieve following:
>>> A user has a possibility to add / change Keystring (I use TextBox) and for each KeyString has a possibility to select Substitute from the list or type something directly. I tried several kinds of comboboxes but still don't succeed, so I changed substitute to textbox also and everything works now (of course, now I always need to type and can not choose from the list). But I still want to know is where some way to do that I want?
>>>
>>> Thanks in advance
>>
>>Combo with Style=0 (drop-down combo) allows to type and/or select. The trick here is that, if you type something which is not in list portion, the typed string never goes to Combo.Value. Instead, you should take it from Combo.Displayvalue
>
> I can try this also (in Valid method, right?), but I am not sure that this will resolve my problem.
>
> First of all, what I need to put in RowSource, RowSourceType?
>
> I tried this:
> SELECT DISTINCT substitute from InstKeys order by 1 into cursor hhh, RowSourceType=3, ControlSource=instkeys.substitute, BoundTo=.t., Style=0 But, in this case I was able only select from the list, not to assign the typing value.
>
> Thanks for your quick response.

Well, firstly, it should be LostFocus (not Valid) event. I would not recommend you to bind this combo, i.e. it will work better with no ControlSource, and subsequently you may forget about BoundTo. Rowsource is regular, personally I prefer fields.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform