List box shows first column of each field in a table

guamlet

Board Regular
Joined
Dec 29, 2002
Messages
145
I have a list box that is to be populated by whatever is found in a particular table called [IHC details]. The table, [IHC details], has several fields in it, that are all referenced back to other tables that contain the allowable variables for input. For instance, [IHC details].[ExpID] is a field that contains a combobox where you can select from an indexed list of names. I set this field to have 2 columns. The first colun is the primary key (numbered 1 to n), and the second column contains the text that I would like to see. I set the column widths in this to be 0";2" to achieve that.

Now, when I try to populate a listbox with the information from this table, all i see are the primary keys for each of the fields, not the text. Does anyone know how to fix this?

Muchas gracias in advance,


Guamlet
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

cstlaurent

Board Regular
Joined
Jan 14, 2005
Messages
182
First you will need to go in the property tab of this control.

In the property box, under the format tab. Modify

Column Count = 2
Column widths = 0;3 (by indicatint 0 for the first column, it will hide your ID KEY) and show the rest of the data.

Good luck
 

guamlet

Board Regular
Joined
Dec 29, 2002
Messages
145
Thanks for the advice. I've tried that already, and all it does is show one column of data. The problem is that the table that is populating the listbox contains several fields that are multi-column. The especially irritating thing about this is, I've gone and done a query, and the query shows the information in the format I would like to see it in my listbox (i.e. the Primary keys are hidden, and the columns of text are shown). I've tried to copy the SQL code behind the query into the Row Source of the list box, as well as directly calling the query from the listbox, but both of those methods also only show the Primary Keys for each field, not the text. There's got to be something that I'm missing...Access can't be this ignorant!

Guamlet
 

Watch MrExcel Video

Forum statistics

Threads
1,118,291
Messages
5,571,331
Members
412,382
Latest member
Langtn02
Top