Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Editing a member in a COMBO BOX?
Message
From
13/11/1997 13:03:46
 
 
To
13/11/1997 12:10:13
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00059768
Message ID:
00059985
Views:
47
>>>>>>>>>>I would like to edit a member of a COMBO BOX and
>>>>>>>>>>save the changes to my table. any ideas?
>>>>>>>>>
>>>>>>>>>Basically, you just edit appropriate field from rowsource (cursor).
>>>>>>>>>Why not to make search in UT? You asked this question many times before.
>>>>>>>>I am taking about making a change in the combox box value area and
>>>>>>>>having that change saved to your table... here is the code I have
>>>>>>>>in the VALID event.
>>>>>>>>
>>>>>>>>replace name with thisform.combo1.displayvalue
>>>>>>>>thisform.combo1.requery()
>>>>>>>>It is not working...
>>>>>>>>The questions I have asked concerning the combo boxz were about adding.
>>>>>>>
>>>>>>>Well, it's something like this:
>>>>>>>*** Combo.InteractiveChange event
>>>>>>>if not empty(this.value)
>>>>>>> this.tag=table1.name
>>>>>>>endif
>>>>>>>*** Combo.Lostfocus event
>>>>>>>local cDisplayvalue
>>>>>>>cDisplayvalue=this.displayvalue
>>>>>>>if this.value<>cDisplayvalue
>>>>>>> select table1
>>>>>>> locate for name=this.tag
>>>>>>> replace name with this.displayvalue
>>>>>>> this.requery
>>>>>>> this.value=cDisplayvalue
>>>>>>>endif
>>>>>>>this.tag=""
>>>>>>>I hope, you use unbound combo.
>>>>>>
>>>>>>Well Ed - I have to say thank you again. This is what I have done:
>>>>>>*** Combo.InteractiveChange event
>>>>>> this.tag=mytable.name
>>>>>> local cDisplayvalue
>>>>>> cDisplayvalue=this.displayvalue
>>>>>> if this.value<>cDisplayvalue
>>>>>> select mytable
>>>>>> locate for name=this.tag
>>>>>> replace name with this.displayvalue
>>>>>> this.requery
>>>>>> endif
>>>>>>This works great if you want to edit you combo box without buffering.
>>>>>>thanks Ed - :))))))))
>>>>>
>>>>>Using InteractiveChange only, you will trigger replacing extra times (when user in the middle of editing). It might be Ok for quick test, but in real situation with implemented RI, it could create tremendous overhead. I think Lostfocus is a little bit better, however I'm not sure that the idea to edit combo items on fly is robust at all.
>>>>
>>>>Good Morning Ed - When I use the code in the LostFocus event, it makes the change to the last record and not the record that is the displayvalue.
>>>
>>>Rob, you have to use code exactly as I gave you (both InteractiveChange and LostFocus)
>>It was not working the way you gave it to me in the Interchange and Lostfocus
>>events. This is what it was doing... 1) making the correct change 2) blanking
>>out the last record. When I move the code to the Interchange event and made
>>some change to the code (see above), it worked fine. I also put your code in the
>>valid event and had a problem with the code making changes to the wrong record.
>
>Rob, you can use any UT advise on your own, however if you make 'correct changes', it's quite natural that another party is completely not responsible for any consequences.
I understand. It should be obvious that a person that uses advice or code from UT or any other FORUM, uses it at their own risk. thanks for you help..
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Reply
Map
View

Click here to load this message in the networking platform