Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding to a combo box
Message
De
15/09/2001 10:50:34
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Adding to a combo box
Divers
Thread ID:
00556919
Message ID:
00556919
Vues:
57
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform