Combo Box Display

GLese

Registered User.
Local time
Today, 10:55
Joined
Feb 13, 2018
Messages
52
I have a bound combo box that the dropdown portion displays 2 columns.
The bound column is 1, and the columns of the query I am displaying are 3 and 4.


Is there a way to make it so that when a line is selected, only the value from column 4 shows up in the combo box? I have a dependent text box that displays the other information.
 
Set the display to be 0; 2 or something similar.
 
I have my display set to properly show the columns I want when the combobox has dropped down.

Let me try phrasing my question differently:

If my query returns the following table:

ID Part Number Name Batch
1 123 Blue Box 032118
2 501 Green Bin 032217
3 489 Red ball 068753

I have the combo box formatted with column widths 0", 0", 1", 1", which only shows columns 3 and 4 in the dropdown portion of the combo box, which I want.

What I want to accomplish is once the user clicks a line, when the dropdown portion of the combo box goes away, only the value in column 4 is shown. Right now it's showing part of the name and batch number.

So is there a way to format this so the dropdown shows everything but when collapsed, the combo box only shows column 4's value?
 
You could use a text box to display the value of column(3) , and place / size it carefully over combo, but not over the arrow.
When you click the arrow you'll get your combo.
Afterupdate you move off the combo, set the value in the text box and move focus somewhere other than the combo.
 
The Column that shows, once you've made a selection, and the dropdown closes, is the first visible Column, so

With Column Width set to 0";0";1";1" to only show Columns 3 and 4, your RowSource would have to be something like this:

Code:
SELECT [YourTable].[ID],  [YourTable].[PartNumber], [YourTable].[Batch], [YourTable].[NName] FROM YourTable;

with Batch as the first visible Column.

Also notice that I changed the Field/Column designated as Name, in your example, to NName, as 'Name' is a Reserved Word, in Access VBA, and using it as the name of a Field should be avoided, as it will cause errors/unexpected results, sooner or later.

Linq ;0)>
 
Last edited:
The Column that shows, once you've made a selection, and the dropdown closes, is the first visible Column, so

With Column Width set to 0";0";1";1" to only show Columns 3 and 4, your RowSource would have to be something like this:

Code:
SELECT [YourTable].[ID],  [YourTable].[PartNumber], [YourTable].[Batch], [YourTable].[NName] FROM YourTable;

with Batch as the first visible Column.

Also notice that I changed the Field/Column designated as Name, in your example, to NName, as 'Name' is a Reserved Word, in Access VBA, and using it as the name of a Field should be avoided, as it will cause errors/unexpected results, sooner or later.

Linq ;0)>


Thanks for this Linq, I've decided to format my form a different way that makes more sense to the end users after getting their opinions, but I'll keep in mind that for later comboboxes where I see that might be helpful!

Also I'm aware of the reserved name issue, was just giving an example table since I'm working with proprietary information and can't upload anything at this point in my build. I appreciate you watching out for me nonetheless!
 

Users who are viewing this thread

Back
Top Bottom