results of combo select

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box with two columns in the row source. I would like when the
user selects that both columns of info would show in the box instead of just
the first column. This is an unbound box and would like it to stay that way.
I will be taking what the user selects and putting it in a query that will
be used to run a report.
 
A combo box can only show a single value, however, you can combine multiple
values to create that value.

Create a 3rd column for your combobox: ColumnAData & " " & ColumnBData
Set ColumnWidths to 0,0,2" (or however wide it needs to be). Only the 3rd
column will display

Not sure what, if anything, you want to use as the BoundColumn, but all 3
values are available to code (or queries):
MyCombo.Column(1), Column(2) and Column(3).

HTH,
 
That is not correct, George. A combo box can show multiple columns, but only
one can be bound.
 
Sorry, unless the person is selecting a new value and thus has the combo
box expanded, the cb can only display 1 value. It is possible to display
multiple columns in the combo box by playing with the properties such as
ColumnCount and ColumnWidths. If you want to display multple values, you
could try adding a text box with its controlSource set to
Me.comboBoxName.Columns(x) I have only used the .columns property in
code so I don't know how it'll look in this situation.
FYI - if its not .Columns(x) then try .Column(x) no 's'.
 
I interpreted the post a little differently. My understanding was he wanted
to see the columns when he selected them. If he wants to see them after he
selected them, then I would suggest doing a screen print while the combo is
dropped down, then pasting it in Word and printing it out for reference :)

Actually, loading the fields into text boxes is about the only way. Could
use a list box, but then you loose some of the functionality of a combo box.
 
That is not correct, George.

I'll stand by my answer, thanks.

The combo-box can only show one column value when it is at rest. In "dropped
down" mode, more that one column can display, but once a selection is made,
only one column will display when the control is back "at rest". I assumed
(and we all know where assumptions lead...) that the OP was wanted to see
multiple values while in the "at rest" state (like both the ProductID and
the ProductDescription), because it was a good "how do I?" question.

HTH,
 
The original statement did not specify the STATE of the control.

"I would like when the user selects that both columns of info would show
in the box instead of just the first column."
 
No matter how one answers the OP, assumptions are being made as to what was
meant. To me, "...when the user selects..." sounds like "once" or "after"
the user selects, (rather than "while selecting" or "during selection"), and
infers the "at rest" state, but that's just my interpretation. Anyone else
is free to interprete the OP as they wish.

HTH,
 
I see there was some debate about what the original intended post was asking
but for what it's worth, I was stuck on figuring out why I couldn't see more
than one column when the combo box was in the resting state and George's
solution worked perfectly for me. Thanks very much, George! You saved me
hours of frustration.
 
George,

I had the same question as the original (as you understood it). However, I
don't know WHERE to create the third column that you've described. Can you
help me with a little more detail, please.

Thanks,
Diane
 
Back
Top