Information générale
Catégorie:
Codage, syntaxe et commandes
>In the present case I am stuck with using the 2nd column for display and the 3rd column as the data to be bound to the control source. How do I do that?
Alejandro:
To rearrange fields displayed, select:
Combobox.RowsourceType=6 and specify the fields in order as follows:
Combobox.Rowsource=tablename.field3,field1,field2,etc...
Specify the field you want to populate the ControlSource in the Value property as:
Combobox.Value=tablename.fieldname
I think this should work for this specific problem.
HTH,
-Irv.
>>Alejandro,
>>
>>They are daunting when you first look into them. See how on RowSourceType property there are many ways to use these. I'm sure that very few people really master all the various RowSourceType ways of using these. I like to use arrays in the lists to display data. You select RowSourceType as array, then in RowSource you put in the name of array. The first column on the array will appear, then I use 2'nd column as a key to seek in table, I use the 3'rd column as a sort column sometimes. I can find what is selected by user with ListIndex. When I do this I don't need to fill out controlsource. Value and DisplayValue are normally the same thing, but not absolutely always.
>
>Thank you Wally. A good start. I like arrays also. Where do you keep the array usually? As a property of the form?
>
>In the present case I am stuck with using the 2nd column for display and the 3rd column as the data to be bound to the control source. How do I do that?
>
>When you say "I can find what is selected by user with ListIndex" do you mean the number of the row that the user selected?
>
>Thanks again.
>
>Alex
>
>>
>>You'll most likely have to rely heavily on the help section and also you'll just have to pick 1 or 2 of those RowSourceTypes to really learn well and master. With 'None' as rowsourcetype you use the AddItem method to add items yourself in code, that can be pretty useful. I think a lot of those RowSourceTypes aren't really that useful in practical use.
>>
>>Wally
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