DISPLAY 2 COLUMNS IN A COMBO BOX

G

Guest

My combo box has 3 columns, a control column and 2 data columns. I can only
display the first data column when the combo box is at rest. The two data
columns display when the combo box list is popped. Is it possible to display
both data columns when the object is at rest (no focus, no popup list)?
 
A

Albert D.Kallal

Yes, just place two additonal text boxes beside the combo box. Set the
contorl souce to

=([me][comboboxname].[column(1))

Notet hat column is zero based, so 1 gives the 2nd collum...
 
V

Van T. Dinh

You need to change the RowSource Query to combine the 2 Columns into one
since the Text component of the ComboBox can only display the value of 1
column in the selected row.

For example, If presently you have PersonID, LastName and FirstName as the 3
Columns, you can set the RowSource of the ComboBox to an SQL like:

SELECT PersonID, LastName & ", " FirstName AS FullName
FROM tblPerson
ORDER BY LastName, FirstName

Set the ColumnCount to 2 and BoundColumn to 1. Set the ColumnWidths as
appropriate.

HTH
Van T. Dinh
MVP (Access)
 

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