Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable Combobox item
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00090101
Message ID:
00090104
Views:
21
>Hi,
>
>I have a combobox populated with a view. In some situations, one item should not be selected. I have two options :
>
>1) Disable this item in the combox list.
>2) Check the value entered and give an error message.
>
>In the first case I don't know how to do it.
>In the second, I'm checking for the value entered in the valid event and returning .F. if it's the wrong choice. But when the valid returns .F. the value is changed anyway. Let me give an example : I have 3 kinds of clients, a person, a firm and a foreign client. In the first 2 types the country in the combobox is automatically changed to BR (Brasil) and in the latter, the user can select all the countries except Brasil. When the country is US and the user select BR, I return an error message and .F. from the valid event, but I want to change the value back to US. How to do it since OldVal() is BR ?
>
>Regards,

Try creating a numeric property to contain combobox.ListItemID in gotfocus. In valid, before returning .F., issue combobox.ListItemID=THISFORM.nProperty - I don't know if this will actually work, but it should in theory.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform