How get combo box to show the entire line of selected item?

  • Thread starter Thread starter Billy Smith
  • Start date Start date
B

Billy Smith

I have a combo box from which my user will select from
a number of lines. Each line has seven columns. When
one of the lines is selected my code runs in the Click
event proc and does what it is supposed to and that
all works fine.

But what remains in the combo box after the user selects
an item is just the text that was in one column (the bound
column). I want the entire line, all 7 columns, to be
visible after the user selects the line. Is there a
way to get the combo box to display the entire line
that the user selected and not just one column of it?
I've searched around and cannot find a way to do it.

A workaround is to read the columns from the selected
line into a set of text boxes to recreate the line. But
displaying these text boxes along with the combo box showing
the one column is kind of clunky.

Thanks in advance.
 
But what remains in the combo box after the user selects
an item is just the text that was in one column (the bound
column). I want the entire line, all 7 columns, to be
visible after the user selects the line. Is there a
way to get the combo box to display the entire line
that the user selected and not just one column of it?
I've searched around and cannot find a way to do it.

One way would be to base the combo box on a Query with a calculated
field concatenating the seven fields. If you make this the first
non-zero width field (which is not necessarily the bound column!!!) it
will be displayed when the combo isn't dropped down (and you can
actually dispense with the individual fields).
A workaround is to read the columns from the selected
line into a set of text boxes to recreate the line. But
displaying these text boxes along with the combo box showing
the one column is kind of clunky.

Maybe clunky but it works fine. You don't need any code - just set the
Control Sources of the textboxes to

=comboboxname.Column(n)

where n is the zero-based subscript of the combo's row source.

John W. Vinson[MVP]
 

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

Back
Top