Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo field reverts to old value when focus returns to i
Message
 
To
05/08/1999 18:56:24
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00249541
Message ID:
00250515
Views:
26
>The valid is the natural place to detect an invalid entry, but if an invalid entry is detected, what is the proper way to restore the combo to its state just prior to the user's entering a bad value?

The purpose for style dorpdowncombo is to allow the user to type ing a value that isn't in the list and then to save that value. if you want to limit the user to nly those items in teh list, that is what the dropdownlist is for.

As for restoring the combo; you would need to use a combo class to which you have added a property named OldValue. In the gotfocus you;

This.OldValue = This.Value

In the valid you would;
IF This.DisplayValue == This.Value && They typed something that is in the list
   RETURN
ENDIF
IF This.DisplayValue is Invalid
   This.Value = This.OldValue
   RETURN 0 && Keeps focus in the combo
ENDIF
* Here you need to handle the new value that was typed and is not in the list
* you may add the value to the rowsource for the combo and then requery the 
* combo.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform