Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding to a combo box
Message
From
15/09/2001 16:42:58
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00556919
Message ID:
00556963
Views:
16
Sergey,

Many thanks....looking at that file solved my problem.

Thanks for the help.


>In order for the new item to show up in the combobox you have to add the new item to the control's RowSource. See file#9596.
>
>>I have a combo box field that is initially pouplated through an sql statement. If one of the choices is not what the user wants, I wanted the user to be able to enter a new value. This is what I have in the valid event of the combo box.
>>
>>IF !EMPTY(this.text)
>>	FOR i=1 TO this.ListCount
>>		IF this.List(i)=this.text
>>		RETURN
>>		ENDIF
>>	ENDFOR	
>>	THIS.AddItem (THIS.text)
>>	cAlias = LEFTC(THIS.controlSource,(ATC(".",THIS.controlSource)-1))
>>	cColumn = RIGHTC(THIS.controlSource,(LENC(THIS.controlSource)-ATC(".",THIS.controlSource)))
>>	THIS.rowSourceType = 3
>>	cSQL = "SELECT DISTINCT " + cColumn + " FROM " + cAlias + ;
>>	  " INTO CURSOR c" + THIS.name
>>	THIS.rowSource = cSQL
>>ENDIF 	
>>
>>After this fires the combo box is left empty and the new value is not among the listed items. What am I missing ?? This seemed pretty straight forward.
Previous
Reply
Map
View

Click here to load this message in the networking platform