469,076 Members | 1,330 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,076 developers. It's quick & easy.

Problem with combo box, have 2 bound columns, only seeing one in box.

167 100+
Using MS Access 2007.
I have a combo box that is defined with 2 columns. A file sequence number and file name. When you click the down arrow in the combo box, you see both columns. However, when selecting a row from the list, only the file sequence number shows in the combo box. In the code when I look at "cmbFileInfo.value", the value is the file name. I am very confused on why I don't see both values when I select the row in the combo box. I believe I have all the properties set correctly but I may be missing something.

On the properties I have:column count = 2
bound columns = 2
column width = 0.5;3"
column heads = no
limit to list = yes
allow value list edits = no
inherit value lists = yes
show only row source values = no
enabled = yes
locked = no
auto expand = yes
Nov 10 '10 #1
3 10112
MikeTheBike
637 Expert 512MB
Hi

The 'visible' field in the list box is the left most field that is visible, ie with a column with width greater than zero.

The value returned by the ComboBox is always from the 'Bound' column.

If you want more than one field to be visible in the list after selection (as opposed to the dropped down list), then the fields required will need concatenating together as one field in the query that is assigned to the ComboBox 'Row Source'. This is then displayed as one field, and would not normally be the bound coulmn. In this case the bound column is often hidden (zero column width).

Hope that makes sense!

MTB
Nov 10 '10 #2
ncsthbell
167 100+
Maybe combo box is not the way I need to go. I do not want to have to worry about parsing 2 values from one string, especially when I don't know what the size may be. Would using a listbox be better?
Nov 10 '10 #3
MikeTheBike
637 Expert 512MB
If you want to display multilpe columns before and after selection then a list box might be better. if you want to use multiple selection then it is the only option. It depends on what you are trying to do.

I'm not sure why you would need to parse a field, as you can have any field you like (you can have a specific field both concatenated and/or on its owm) in the ComboBox list records, and have them hidden if they are not relevant to the user.

You can then access the required field of the selected item in the list by using the ComboBox.Column(ColumnIndex) propery to capture any of the fiields values, visible or otherwise.

MTB
Nov 11 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Julie Barnet | last post: by
reply views Thread by Jon | last post: by
1 post views Thread by Chicagoboy27 | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.