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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get both columns in a list box (Access 2003) 2

Status
Not open for further replies.

BSman

Programmer
Apr 16, 2002
718
US
I have two list boxes, similar to the standard method of selecting columns from a table to be used for output, sorting, or whatever. My data source for the first box is a two column query with the name of the column in the table and the "column name" I want displayed to the user. I can't find a way to move both columns of a row to the second box. I only seem to be able to access the first column. Does anyone know how to get the value of both columns in a list box?

Bob
 
Look at the Column property of the listbox. In vba, type in your listbox name.Column(x,y) Highlight Column and hit F1. It'll show you examples. X is column, Y is row. I think. They start counting at 0.
 
fneily,

Thanks, that solves my problem. And you are right, the x (in Column(x,y)) is the column and y is the row, which is backwards from the way you normally think of referring to items in an array.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top