Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo field reverts to old value when focus returns to i
Message
From
04/08/1999 08:42:47
 
 
To
03/08/1999 22:41:32
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00249541
Message ID:
00249665
Views:
23
>>I have a combo control whose rowsource is a table field. It exhibits the following rude behavior.
>>
>>Suppose I use the combolist (not the editbox) to choose value x. Fine.
>>
>>Then, prior to leaving the combo, I manually type value y (a legal value) and it is accepted. The ENTER that registers value y invokes a VALID which checks for hunkydoriness, refreshes the form and then returns .T. so that focus moves to the next control in the tab order.
>>
>>Fine.

wait a minute. Look what you are soing here. Running code in the control's valid event that refreshes the form. We know that a control write's its value to its controlsource somewhere between the valid and the lostfocus events. But more importantly, we know that a control gets it's value from the controlsource during the refresh event. So if you change a value in the combobox, and call THISFORM.Refresh in the combo's valid, you are tellin the combo to get it's value from the controlsource again. Combos can be strange to deal with sometimes, because the value property can be different from the DisplayValue property, which reflects what is actually displayed, but I bet that this is the root of your problem.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform