Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box Question
Message
De
04/12/2008 09:33:57
 
 
À
03/12/2008 16:01:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01365396
Message ID:
01365480
Vues:
17
>>>I've got a Combo Box that has a list of names. The users want to also be able to pick a name from a browse form - ok, not a problem. I can set the DisplayValue so that the name selected shows in the closed combobox, but I also need to 'set' the ComboBox index so I can get other information that corresponds to that name.
>>>
>>>Which property do I use?
>>
>>If you get names from the table, then bind combobox.value to table.id and then use Combo.Value to search in the table.
>
>Nope, that's not how it works. They want to be able to either use the combobox to select a name (which is pulled from a different table via SQL and loaded into the combobox) or they want to select the name from an existing Patient browse form and have that display in the closed combobox.
>
>The patient browse works - I load the name selected into the cbo.DisplayValue. I need to get the combobox 'set' to that DisplayValue, so I can know if 1) the name selected is in the Combobox list or 2) the corresponding information out of the other table that's already in the combobox list.

You can fill all data (to retrieve later) in the combobox itself using AddListItem and then find it when selected (in LostFocus or InteractiveChange event) by scanning through the the source and chacking for .Value. However, a bit more consistent way, imo, would be filling combobox in first place with Patient.Name and Patient.ID (AddListIem, 2 columns), binding combobox value on ID (combo.boundcolumn=2), and searching in the table(s) when ID is selected.
When you pick up name from browse, you don't need to set Combo.DisplayValue, instead you use PatientID to set Combo.Value.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform