That's not how it works. If you need to display column 2, make sure you
specify that column 2 has a nonzero width. If you don't want to also display
column 1, make sure column 1 has a width of zero.
BoundColumn indicates which column of the listbox is returned when you query
ListBox1.Value. If BoundColumn is 1 or omitted, .Value returns what's in the
first column of the selected row. If BoundColumn is 2, it returns what's in
the second column of the selected row.
Similarly with TextColumn, which indicates which column of the listbox is
returned when you query ListBox1.Text. If TextColumn is 1, .Text returns
what's in the first column of the selected row. If TextColumn is 2, it
returns what's in the second column of the selected row.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______
"Nigel" <nigel-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> That was my point, if you need to display column 2 (The Description) set
> the BoundColumn to 2. I accept it does not answer the OPs other quest to
> return the ID #.
>
> --
> Cheers
> Nigel
>
>
>
> "Jon Peltier" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> From help file on BoundColumn:
>>
>> "Assigns the value from the specified column to the control."
>>
>> This means the value from the selected row of the listbox and from the
>> bound column is what is stored as the .Value of the listbox.
>>
>> - Jon
>> -------
>> Jon Peltier, Microsoft Excel MVP
>> Tutorials and Custom Solutions
>> http://PeltierTech.com
>> _______
>>
>>
>> "Nigel" <nigel-(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> The bound column property determines the first column of data.
>>>
>>> BoundColumn = 2
>>> ColumnCount = 1
>>>
>>> will show description only.
>>>
>>>
>>> ---------
>>> Cheers
>>> Nigel
>>>
>>> <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> OK, I have a record set that has say the following rows
>>>>
>>>> ID Description
>>>> ----------------------------------------------
>>>> 1 Apple
>>>> 2 Book
>>>> 3 Cat
>>>>
>>>> ***************************************************************************************
>>>> I have done the following code to populate the listbox
>>>> (Design view Properties)
>>>> BoundColumn = 1
>>>> ColumnCount = 2
>>>> TextColumn = 2
>>>>
>>>> (Code)
>>>>
>>>> Set RS = cmd.Execute
>>>> Me.lstPayCycles.Clear
>>>> Me.lstPayCycles.Column() = RS.GetRows
>>>>
>>>> ***************************************************************************************
>>>> When the form displays it displays the ID and Description. I've tried
>>>> everything to get only the description only to display. See I want to
>>>> display the description, but then retrieve the ID, when I need to use
>>>> it.
>>>>
>>>> I've tried setting Column Count to 1: That displayed the ID's, even
>>>> though TextColumn = 2
>>>>
>>>> Any ideas???
>>>>
>>>> Thanks...
>>>>
>>>
>>>
>>
>>
>
>