Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box Add Item Problem
Message
 
À
05/11/1997 21:50:31
Carol Adler
U.S. Army Kwajalein
Apo, Iles Marshall
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00058529
Message ID:
00058535
Vues:
36
>Using VFP5.0a. Have a combobox with the rowsourcetype = SQL and the statement is: select distinct company from tdypers.company into cursor listcompany. The control source is tdypers.company.
>
>I need to either select from the dropdown list or enter a new value.
>
>Tried the code in Steve Sawyer's book (VFP Form Designer, Page 132) but it did not work. I do want to update the control source. I do want to dispaly the new item in the combo box. I do want to combobox.requery() and have the new item listed. I'm missing something, and it must be my reading comprehension.
>
>Enlightenment would be appreciated.

Carol, Edward Pikman has written several messages about this. You might want to look for some of them in the archives.

First you need to change the control source to blank (not linked to the company field).

Then when the user types a new item into the box you should add a record to the tdypers table with the new entry.

Finally, requery the combo SQL and refresh the combo.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform