Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List box selection problem.

Status
Not open for further replies.

martinrobson

Programmer
Jun 2, 2003
19
0
0
GB
Hello,

I have a list box, which has 8 columns in which there are 5 unique id entries.

Is it possible to add another column to the listbox, so that i can have a unique value for each entry in the listbox. The problem is that at the moment none of the id's are completely unique. Something as simple as having a column with autonumber on would do.

At the moment the listbox is populated by an SQL query.

I hope someone can help.

Thanks
 
Just add another column to the SQL query. Each column in the query becomes a column in the list box. I assume the table underlying the query has a primary key. You could add that to the query. (You can also have an invisible column in the list box, but I doubt that's what you want in this case.)

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Hi,

Thanks for the reply, i am having major problems with this listbox. It is displaying data from 5 tables and has the primary keys and foreign keys from each one on the list. One thing you said is that i can make columns invisible, how do i do this?

Thanks
 
Use the Column Widths property. It's an unusual property in that it contains multiple values separated by ";" characters. See the help file for an example of how to code it.

Set the widths of the columns you want to be invisible to 0. Leave the widths of the other columns blank, to get the default width based on the field size (unless you specifically want to control their widths). For example, if you have 6 columns and you want the 1st and 4th to be invisible, you would set the property to "0;;;0". If you want the 5th column to be 1/4" wide as well, it would be "0;;;0;.25".

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top