Link to home
Start Free TrialLog in
Avatar of J G
J G

asked on

Display 2 columns in combobox view

I have a combo box with 2 columns.  When I click on the arrow I see both of them. But when I make a selection and tab to the next field, I only see column 1 in the combo box.

How can I see both?
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of J G
J G

ASKER

I tried both your suggestions, I can't get the following to work right.  It just shows vendor name in the combobox with no choices when I hit the arrow.


SELECT tbl_Vendor_Item.Vendor_Name & "-" & tbl_Vendor_Item.Order_Code
FROM tbl_Store_Item INNER JOIN tbl_Vendor_Item ON tbl_Store_Item.PLU = tbl_Vendor_Item.PLU
WHERE (((tbl_Vendor_Item.PLU)=[Forms]![Item_Master]![PLU]));
The combobox cannot show more than your query - which returns one field only.

You must return two fields, one with the key/value to return, one with the combined values to display.
And then adjusted properties as I showed you.

/gustav
Avatar of J G

ASKER

I altered my query to the following, still the same result

SELECT DISTINCT tbl_Vendor_Item.Vendor_Name, tbl_Vendor_Item.Order_Code,  [Vendor_Name] & " - " & [Order_Code] AS VendorandItem
FROM tbl_Store_Item INNER JOIN tbl_Vendor_Item ON tbl_Store_Item.PLU = tbl_Vendor_Item.PLU
WHERE (((tbl_Vendor_Item.PLU)=[Forms]![Item_Master]![PLU]));


•BoundColumn: 1
•ColumnCount: 2
•ColumnWidths: 0
Well, now you have three colums/fields. That is not two.
To hide the first tow:

  • ColumnWidths: 0,0

But I guess you need to return the order no., thus stick with two fields:

SELECT DISTINCT
    tbl_Vendor_Item.Order_Code,  
    [Vendor_Name] & " - " & [Order_Code] AS VendorandItem

Open in new window

/gustav
Avatar of J G

ASKER

I'm a little confused.  

I actually want to return 2 fields (vendor_name, order_code),  and also display the 2 concatenated  fields.   Unless I am mistaken, the example above returns only Order_Code, and displays the 2 concatenated  fields.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial