Combobox: value from third in stead of first column

J

John

I have a combo box with 3 columns. When I choose one of the combo's rows,
the combobox gets the value from the first column. Is it possible to have
the combobox get the value of the third column? I tried changing the
'dependent' column property to 3 but that doesn't help.
Thanks in advance,
John
 
D

Dirk Goldgar

John said:
I have a combo box with 3 columns. When I choose one of the combo's rows,
the combobox gets the value from the first column. Is it possible to have
the combobox get the value of the third column?

The Bound Column property determines which column the combo box gets its
value from. You'll find that on the Data tab of the combo box's property
sheet.
I tried changing the 'dependent' column property to 3 but that doesn't
help.

I don't know what you mean by that. If my answer above doesn't help, please
explain.
 
J

John

Thanks Dirk.

I translated it from Dutch. The 'Dependent column' property in fact is the
'Bound column' property. Whatever value I give that property, the combo box
always takes its value from the first column. This is Access 2003 and the
combobox is an unbound field.

John
 
J

John

This is even weirder.

Like I said the combo always gets the value of the first column, even when
the bound column is set to for instance 3. However if I check for the
combo's value in code by
MsgBox MyComboBox
it shows me value of column 3, while the value actually showing in the combo
is the value of the first column.

John
 
R

Rick Brandt

John said:
This is even weirder.

Like I said the combo always gets the value of the first column, even
when the bound column is set to for instance 3. However if I check
for the combo's value in code by
MsgBox MyComboBox
it shows me value of column 3, while the value actually showing in
the combo is the value of the first column.

The bound column property does not determine which column is displayed when a
choice has been made. That is always the left-most column with a width greater
than zero.

Showing one column while holding the value of another is one of the fndamental
uses of a ComboBox. If it always displayed the bound column then you would lose
this feature.
 
J

John

Thanks! I now get the idea that the value that is shown is not necesseraly
the value of the combo box.
John
 
L

Linq Adams via AccessMonster.com

As Rich said, the left-most column with a width greater than zero is shown,
so when you create your combobox be sure to move the field you want to
appear first, then move your other fields over.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top