Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding to a combo box
Message
De
15/09/2001 16:42:58
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00556919
Message ID:
00556963
Vues:
15
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform