Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo boxes
Message
De
11/05/2000 05:59:08
 
 
À
11/05/2000 05:55:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00368441
Message ID:
00368449
Vues:
15
>>>I need a drop down combo that lists all of the distinct values already in that field, for example, selecting a company from a list of companies already in the database, you also need to be able to enter a new company. How do I do this?
>>
>>
>>The quick and dirty way is to set your rowsource to 3 - SQL and the rowsource to SELECT DISTINCT company FROM yourtable INTO CURSOR cCompanySQL. Set the controlsource to company field in your table.
>
>And for enter new company add this code in the valid event from the combo.
>
>If This.ListIndex = 0 AND !EMPTY( This.DisplayValue )
>* Your append code
> This.Requery()
>Endif
>
>Cemal

For append code you can use

insert into companies (Name) values (this.displayvalue)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform