combo box question

  • Thread starter Thread starter Jerry Crosby
  • Start date Start date
J

Jerry Crosby

I have a table with two fields: building name & building color.

On a form based on a different table, I want to have the user select a
building name from a drop-down list, but have the building color be what is
stored in the field on the underlying table. I know I can have both colums
visible in the combo box, but I want just the building name to appear in the
combo box (but the building color is what's actually stored in the field).

I know there's a way, I just can't recall how. It's Friday.

Jerry
 
Assuming that you don't need to show the building color in the dropdown
list....

Set the RowSource to this query:
SELECT BuildingColor, BuildingName
FROM Buildings
ORDER BY BuildingName;

Set the ColumnCount to 2.
Set the ColumnWidths to 0";2".
Set the BoundColumn to 1.

If you want the color to show in the dropdown list, then reverse some info:

Set the RowSource to this query:
SELECT BuildingName, BuildingColor
FROM Buildings
ORDER BY BuildingName;

Set the ColumnCount to 2.
Set the ColumnWidths to 2";1".
Set the BoundColumn to 2.
 
Back
Top