display of a combobox (should be simple..)

N

Not Me

Hi,

I have a table as a combobox's rowsource. The control source is based on
column 1 of this table, however I would like to display <at least> column 2
on the combobox when it is not selected, and <at least> column 1 in the
combobox when making a choice.
I can almost acheive this by altering the column widths, and if I set them
to 0;4 for example, it shows the second column fine. The problem is the
first column isn't shown when making a choice. If I give both columns
sufficient width, then it looks fine for selecting a value, but when
selected only shows the bound column.

So is there a way of showing more than the bound column in a selected
combobox? Am I looking at a function to alter the text in the combobox, and
would this interfere with the controlsource (i.e. if i change the visible
text will it alter the fields in the table it's based on?)

Hope you can understand that! Should be simple though :blush:P
Cheers,
Chris
 
G

Gerald Stanley

The information that is shown in the text part of the combo
box when an item is selected is from the first visible
column of the rowsource. Should you want to show two
columns in the text box, the usual procedure is to alter
the rowsource sql to something along the lines of
SELECT col1 & " " & col2, col1, col2 FROM etc
then setting the column widths so that the first is very
small(e.g. 0.2) so that the concatenation cannot be seen in
the dropdown and setting the bound column to a higher value
to pick up one of the unconcatenated columns.

Hope This Helps
Gerald Stanley MCSD
 
N

Not Me

Gerald Stanley said:
The information that is shown in the text part of the combo
box when an item is selected is from the first visible
column of the rowsource. Should you want to show two
columns in the text box, the usual procedure is to alter
the rowsource sql to something along the lines of
SELECT col1 & " " & col2, col1, col2 FROM etc
then setting the column widths so that the first is very
small(e.g. 0.2) so that the concatenation cannot be seen in
the dropdown and setting the bound column to a higher value
to pick up one of the unconcatenated columns.

Nice one, much appreciated.

Chris
 

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