General information
Category:
Forms & Form designer
>>>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)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only