473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 10466
MikeTheBike
639 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
639 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

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

Similar topics

0
by: Julie Barnet | last post by:
I would like to be able to either autogenerate my bound columns or create them at runtime based on parameters passed into the page. When doing either method, I cannot access any of the fields. ...
9
by: Bazza Formez | last post by:
Hi there, For some reason, when I edit row in my datagrid, some columns have (an unwanted) back color of yellow, while others correctly display with white back color. I can see no setting in...
1
by: Chad Devine | last post by:
Alright, I am posting my solution to a problem I've been having. I have finally found the answer, and it took me a while so I thought I'd provide the final solution here, since it may be benificial...
0
by: Jon | last post by:
Hello all, If I have a datagird with a number of columns, say 3, and then I add another one dynamically, obviously it will have no data, what's the best way to get the data, do I have to rebind?...
1
by: Chicagoboy27 | last post by:
It seems when I use GridView1.Columns.Insert(2, nameColumn); to dynamically insert a column into a grid I loose all items that are bound using <asp:TemplateField HeaderText="E-Mail" >...
0
by: methexandude | last post by:
Hi, I have recently started developing ASP.net applications using VB.net. Well, I created this huge query to retrieve data from SQL Server and create a pivot table, which means I'm creating columns...
0
by: sarbjit sandhu | last post by:
Hi every one i am facing a problem regarding the gridview, bc.HeaderText = M_colHead; bc.DataField = M_colNam; GridView1.Columns.Add(bc);//error here GridView1.DataSource...
1
by: blizzardice | last post by:
I have a table that has a 3 field primary key. Company , Last Name first Name I have a combobox that lists all three and populates 3 textboxes based upon the selected item. The problem seems to be...
4
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields...
0
by: Tony K | last post by:
I made a grid with several columns. 2 of the columns are foreign keys from 2 other tables in the datasource. I am unable to sort alphabetically by the combo box columns when I click on the column...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.