Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use combo box bound to field
Message
From
16/01/2006 08:33:17
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01087103
Message ID:
01087122
Views:
15
Yes, I know this but your code, to me, seems to be inserting a value into the look-up table without first checking whether or not it already exists. Unless the fact that the value was ALLOWED to be entered (and wasn't autofound in the list as you typed) means that it doesn't exist. But, then again, it wouldn't check for case, would it?

Far be it from me to challenge your code, Sergey; I'm just intrigued as to how it works. As I said in my 1st reply to Dmitry, I've never used a combo in this manner before.

Terry

>The current value - This.Value.
>The typed value - This.DisplayValue
>
>
>>Please enlighten me. How does this check whether the input value already exists in the look-up, before deciding to write the new value to the table? As I read it, it only checks the current value of the combo. But then again, sometimes I'm dyslexic at reading others' code :-)
>>
>>Terry
>>
>>>>Try
* Combo Valid
>>>>IF NOT EMPTY( This.DisplayValue )  ;
>>>>		AND NOT (ALLTRIM(This.DisplayValue) == ALLTRIM(This.Value))
>>>>	INSERT INTO mytable VALUES (This.DisplayValue)
>>>>	This.Value = This.DisplayValue
>>>>	THIS.Requery()
>>>>ENDIF
>>>>
>>>>>
>>>
>>>Thank you very much, Sergey. I will try your approach.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform