Multi-Column Combo Box

R

r. howell

I have a multi-column combo box on a form, to enable the users to select a
meaningless foreign primary key. There are actually three columns, one
hidden (the foreign primary key) and then two pieces of data (project number
and trade) which enable the accurate selection of the foreign primary key
which is the data I am actually storing in the table.

My problem is this: When you go to input data, this is working just fine,
and you can see both of the other columns, the ones that carry meaning to the
client. After you select one, the third column (second of meaningful
information) is not displaying. There is plenty of space, and the width for
the column under properties is not zero. What is wrong, and how do I get
this column to show?

Thanks
 
W

Wayne Morgan

Only the first visible column will show in the combo box after you have made
your selection. If you only need to see one of the columns, change the order
of the columns so that the one you want to see is the first visible one. To
change the order, simply change the order the columns are listed in the
query being used as the Row Source.

To display both columns after making a selection, add a textbox next to the
combo box and set the Control Source of the textbox to the desired column.

Example:
=cboMyCombo.Column(2)

This would display the 3rd column, the index number is zero based.
 
J

Joan Wild

r. howell said:
My problem is this: When you go to input data, this is working just
fine, and you can see both of the other columns, the ones that carry
meaning to the client. After you select one, the third column
(second of meaningful information) is not displaying. There is
plenty of space, and the width for the column under properties is not
zero. What is wrong, and how do I get this column to show?

Change the rowsource of the combobox

SELECT ID, [project number] & " - " & [trade] FROM Whatever.....
Then change the combobox properties to reflect...
2 columns
column widths 0;2
bound column 1
 

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