Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00584131
Message ID:
00584513
Views:
37
Thanks for the explanation Jim. Could you please ellaborate and/or give an example of what you mean for, "do your own data binding in the LostFocus and GotFocus of the combo and forget about the ControlSource property" because the behaviour you describe is what I'm after -- Allow the user to choose from the list or enter a value but the new value is not added to the list. This is because the users want to be able to enter what they want but the "master" list can only be updated by a superuser.

>Colin,
>
>Combo's have two properties that hold the displayed value of the combo, DisplayValue and Value. The Value property is used to update the ControlSource, but the Value property will be blank if the DisplayValue is not part of the combo's internal list of values.
>
>The solution is to AddListItem() what the user typed into the combo so the Value proeprty can accept that value. You can do this in the Valid event of the combo checking DisplayValue = Value and if they don't then AddListItem the DisplayValue.
>
>If you don't want the new item added to the combo's list then you will need to do your own data binding in the LostFocus and GotFocus of the combo and forget about the ControlSource property.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform