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.

Multi-select list box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Pockmire - 29 Dec 2006 12:43 GMT
Is there a way to change all items in a listbox to selected or de-selected
via code in one step? i.e. without looping through the ItemsSelected(I)
collection and changing each item to true or false?
Rick Brandt - 29 Dec 2006 13:05 GMT
> Is there a way to change all items in a listbox to selected or
> de-selected via code in one step? i.e. without looping through the
> ItemsSelected(I) collection and changing each item to true or false?

Without looping? No way I know of.  And you wouldn't loop through the
ItemsSelected collection anyway as that would provide no access to rows not
already selected.  You would loop using the ListCount value to control the
number of loops and the row being accessed.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Douglas J. Steele - 29 Dec 2006 15:19 GMT
Deselecting all is easy: simply reset the RowSource or set the Listbox to
Null (the latter doesn't work for MultiSelect = Simple)

Selecting all can't be done without looping.

Signature

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

> Is there a way to change all items in a listbox to selected or de-selected
> via code in one step? i.e. without looping through the ItemsSelected(I)
> collection and changing each item to true or false?
 
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.