Displaying the 2nd Column in a Combo Box

milkman2500

Registered User.
Local time
Today, 10:02
Joined
Oct 21, 2012
Messages
45
Hi,

I've created a form with a combo box to allow users to set the Manager of an employee. I've set the control source for the combo box to the Managers table that contains a primary key and the manager's name.

I've set the bound column to 1, the column count to 2, the column widths to 1;2 (I want to show both columns in the drop down because users can identify managers by either their name or Manager ID).

After updating the combo box, the Manager ID shows rather than the Manager Name. Is there a way to have the Manager name show instead of the Manager ID without setting the column widths to 0;2?

Thanks.
 
Unfortunately not.

What you can do is have a separate text control with it's controlsource set to

Code:
=[ManagersComboBox].column(1)

Would also set its enabled property to false

Note: bound columns start from 1 in the combo property sheet, but 0 in VBA
 
Thought so. Thanks for the reply.
 
Unfortunately not.

What you can do is have a separate text control with it's controlsource set to

Code:
=[ManagersComboBox].column(1)

Would also set its enabled property to false

Note: bound columns start from 1 in the combo property sheet, but 0 in VBA

Hi - I am doing this where I pick an item in the combo box and put the price in a text box from the second column in the combo box. It works fine except the value is General number format. In the original table the price field is Currency. I've tried formatting the text box field also as Currency but the price is still in General number format. Is this a bug or a "feature"? Is there any way round it because it does not look great.
Tom
 
If you have defined the field in your table as datatype=currency, then it should not be a problem.

It may be that Access thinks the value is a text value - are you formatting it in the rowsource for the combo box (i.e. using the format function)? If so it it will result in a text value, the format as currency for the control should work so suggest modify your rowsource to bring through the value twice, once formatted and once unformatted.

Then hide the unformatted column and set the control source to your text box to refer to the unformatted column.
 
I sorted out my problem. It had to do with operating on a control rather than a field - an annoying theological distinction - so I created a field in the subform table for Price and it worked out.
Thanks for your help.
Tom
 

Users who are viewing this thread

Back
Top Bottom