Combobox Display

G

Guest

I have a combobox with 2 columns (1 bound). It is used to display PlantID and
PlantName. PlantID is the bound column. When selecting the required PlantID
from the drop down both columns are displayed. When the selection has been
made, and the combobox is rolled up, only the PlantID is displayed (as
expected). Is there a way to have both columns displayed?

Thanks

Dave
 
K

Keith Wilby

David M C said:
I have a combobox with 2 columns (1 bound). It is used to display PlantID
and
PlantName. PlantID is the bound column. When selecting the required
PlantID
from the drop down both columns are displayed. When the selection has been
made, and the combobox is rolled up, only the PlantID is displayed (as
expected). Is there a way to have both columns displayed?

Not that I'm aware of but you could fake it with a text box next to the
combo box.

Keith.
www.keithwilby.com
 
S

Sandra Daigle

A combo can only display one field/column from the rowsource query. The
column that is displayed in the unexpanded control will be the first column
with a non-zero width. You can hide the Id field if you don't need to see it
by putting something like "0,1" (no quotes in the property) in the
ColumnWidths property of the combo. The id field will still be saved to the
control but the name will be visible.

If you really need to see more than one field then add another textbox to
the form. In the controlsource of the text box you put a reference to the
appropriate column of the combo. Note that the column property is indexed
starting with 0. So for example, if you want the 2nd column to be displayed
in this textbox your reference would be:

=MyCombo.column(1)
 
G

Guest

Thanks. I didn't think it would be possible so I just used a textbox bound to
the appropriate control source. Not quite the elegant solution I was looking
for though.

Dave

Sandra Daigle said:
A combo can only display one field/column from the rowsource query. The
column that is displayed in the unexpanded control will be the first column
with a non-zero width. You can hide the Id field if you don't need to see it
by putting something like "0,1" (no quotes in the property) in the
ColumnWidths property of the combo. The id field will still be saved to the
control but the name will be visible.

If you really need to see more than one field then add another textbox to
the form. In the controlsource of the text box you put a reference to the
appropriate column of the combo. Note that the column property is indexed
starting with 0. So for example, if you want the 2nd column to be displayed
in this textbox your reference would be:

=MyCombo.column(1)

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have a combobox with 2 columns (1 bound). It is used to display
PlantID and PlantName. PlantID is the bound column. When selecting
the required PlantID from the drop down both columns are displayed.
When the selection has been made, and the combobox is rolled up, only
the PlantID is displayed (as expected). Is there a way to have both
columns displayed?

Thanks

Dave
 

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