Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box just won't keep hand entered text
Message
From
08/07/2006 09:12:36
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00987581
Message ID:
01134667
Views:
35
>>
>>What if the user enters the text and them presses < Enter >? Does it stay then?
>
>Yes, with the code from Marcia it stays there. If I then go back to the combobox and re-type the value, both values stay in the list. This is untill I saved the data and requery combobox using actual tables rather than this select.
>
>I guess there is no simple way around it (unless keeping all new entries in array ( or additional cursor) and deleting them from this cursor when a new value typed over the previous one). I'm wondering if this idea worth implementing or these bad new entries are not a big deal.
>
>(The other idea is always replace the last physical record in the cursor with the new value)
>
>What do you think?
>
>UPDATE. Ok, while I was waiting your reply I went ahead and implemented this:
>
>Init of the combo:
>
>dodefault()
>this.AddProperty('lValueInserted',.f.)
>this.AddProperty('cValueInserted',"")
>
>valid of the combo:
>local lcValue, lcOldValue
>lcValue = this.displayvalue
>if not empty(m.lcValue ) and this.listindex = 0
>*** The user typed in something that is not in the combo's
>*** list. Take action here to add the entry
>	if this.lValueInserted
>		lcOldValue = this.cValueInserted
>		replace cShort_Name with m.lcValue for cShort_Name == m.lcOldValue in curShortNames
>	else	
>		insert into curShortNames (cShort_Name ) values (m.lcValue)
>	endif	
>	this.requery()
>	this.value = m.lcValue	
>	this.lValueInserted = .t.
>	this.cValueInserted = m.lcValue
>endif
>this.parent.chkDefault_Carrier.enabled = not empty(m.lcValue)
>
I am retired and only write code for myself. When I run into this I add a save button and the appropriate code to write the record and the problem is solved for me.
I ain't skeert of nuttin eh?
Yikes! What was that?
Previous
Reply
Map
View

Click here to load this message in the networking platform