Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

Multiselect listbox non-bound columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Pockmire - 14 Dec 2006 19:22 GMT
How do I reference non-bound columns in the "ItemsSeleced" collection?
OfficeDev18 - 14 Dec 2006 20:01 GMT
By number, starting from 0, NOT 1. Hence you would refer to a field as .
Column(X, intCurrentRow), where X is the column number, and intCurrentRow is
the number of the row of the selected item within the list box.

Hope this helps,

Sam

>How do I reference non-bound columns in the "ItemsSeleced" collection?

Signature

Sam

Jim Pockmire - 14 Dec 2006 21:07 GMT
But, whatc ode would I use to reference just the "ItemsSelected" collection
and not entire list box collection (that's where I'm stuck).

> By number, starting from 0, NOT 1. Hence you would refer to a field as .
> Column(X, intCurrentRow), where X is the column number, and intCurrentRow
[quoted text clipped - 6 lines]
>
>>How do I reference non-bound columns in the "ItemsSeleced" collection?
OfficeDev18 - 14 Dec 2006 22:00 GMT
Jim,

Look in the help file for the Selection property. MS gives you all the code
you need.

Sam

>But, whatc ode would I use to reference just the "ItemsSelected" collection
>and not entire list box collection (that's where I'm stuck).
[quoted text clipped - 4 lines]
>>
>>>How do I reference non-bound columns in the "ItemsSeleced" collection?

Signature

Sam

OfficeDev18 - 14 Dec 2006 22:31 GMT
Oops, I meant the Selected property.

Sorry,

Sam

>Jim,
>
[quoted text clipped - 8 lines]
>>>
>>>>How do I reference non-bound columns in the "ItemsSeleced" collection?

Signature

Sam

Douglas J. Steele - 14 Dec 2006 22:11 GMT
Dim strSelected As String
Dim varSelected As Variant

 For Each varSelected In Me.MyListBox.ItemsSelected
   strSelected = strSelected & _
     Me.MyListBox.Column(1, varSelected) & vbCrLf
 Next varSelected

 MsgBox "The 2nd column of all of the selected items is: " & vbCrLf & _
   strSelected

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> But, whatc ode would I use to reference just the "ItemsSelected"
> collection and not entire list box collection (that's where I'm stuck).
[quoted text clipped - 9 lines]
>>
>>>How do I reference non-bound columns in the "ItemsSeleced" collection?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.