Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>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
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