Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement