Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropdown Combo Mombo Jombo
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00224937
Message ID:
00224941
Vues:
18
>I have a dropdown combobox based upon an array. The array loads at Form Init time based upon a table of local city names and codes. The array is a list of local cities. Each city has a 3-digit code associated with it that gets saved instead of the whole city name when you pick a city from the dropdown list. That all works and saves just fine, but when I type my own entry in the text portion of the combobox rather than selecting from the dropdown list. It doesn't seem to save the text that I type. For instance, when you need to type in the name of a city that does not exist in the dropdown list. But it does save a code from the array when I choose a city from the dropdown list.
>
>Here are my combobox settings:
>BoundColumn 2
>ColumnCount =ALEN(acity,2)
>ColumnLines .F.
>ColumnWidths 250,0
>ControlSource myTable.myCity1
>DisplayValue cbo_city
>FirstElement 1
>Number of Elements =ALEN(acity)
>RowSource acity
>RowSourceType 5-Array
>Style 0-Dropdown Combo
>
>Can't I do what I am trying to do or am I doing something wrong?
>Thanks for the help...
>
>Steve Kramer
>Kramer & Kramer Design

In the LostFocus of the combo you will need to test on the Value and DisplayValue properties. If they are different, the user typed in a "new" entry. You must then "process" the new entry, i.e. add the data to the combo array and Requery() the combo for it to be displayed, plus do whatever other processing you need to save the data to a table if required.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform