Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo lookups
Message
De
06/11/2006 12:19:19
 
 
À
01/11/2006 18:46:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
01166441
Message ID:
01167347
Vues:
8
>>I've come across a combobox situation that is new to me and I would appreciate a brief tutorial. The function is basically a lookup. My difficulty is that I want to store one field and display another. The situation is this:
>>
>>Maintable1 has an integer field to store employeeID.
>>The combo.controlsource is maintable1.employeeID.
>>The combo is populated from lookuptable.employeename and lookuptable.employeeID.
>>The combo will display the employeename both when it is open and when it is closed.
>>
>>Is this possible?
>
>The field you store is different from the field you show, right?
>
>List two columns in the ComboBox RowSource, but set the number of columns (i.e., visible columns) to 1. Set BoundColumn to 2, the invisible column.

I thought I had this licked. I set it up as you suggested except I left both columns visible. This is the same way the builder did it. It seemed to work OK on the form. It displayed the names correctly and changed them Ok when the box was operated. Then I discovered that the value being stored is the wrong value. Even though the name displays right, the value stored into the table does not match the name ID. It appears the value being stored is the name's position in the dropdown list rather than the value in the second column. BoundColumn is set to 2. It works the same way with the cursor sorted or not sorted. Any more thoughts?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform