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 / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

List View question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
whistler - 04 Jul 2007 14:39 GMT
Short and crisp question:

How do you reference to listitems in multi selections in List Views?

any hints are most appreciated...

regards, Jos
Damon Heron - 04 Jul 2007 17:32 GMT
If you want the items selected, call something like this on each lstbox
click event:

Public Sub Add()
   Dim frm As Form, ctl As listbox
   Dim varItm As Variant
   Set frm = Forms!YourformName
   Set ctl = frm!YourlstboxName
   ' loops thru lstbox to get total selected
   For Each varItm In ctl.ItemsSelected
       C = C + CSng(ctl.Column(1, varItm)) 'this example just adds the
numbers in columns 1
       W = W + CSng(ctl.Column(2, varItm)) 'same as above for column 2
   Next varItm
   Set ctl = Nothing
   Set frm = Nothing
       'puts values in textboxes
   Me.txtC = C
   Me!txtInUse = W
End Sub

Damon
> Short and crisp question:
>
[quoted text clipped - 7 lines]
> ------=  Binary Usenet downloading made easy =---------
> -=  Get GrabIt for free from http://www.shemes.com/  =-
whistler - 05 Jul 2007 05:21 GMT
Thanks a lot for that. But I am asking after multiselect handling in a listVIEW not a listBOX. The method you describe is not available for listviews.

regards, Jos
AccessVandal - 05 Jul 2007 10:19 GMT
Hi,

Something like....

Dim ctl As MSComctlLib.ListItem
For Each ctl In Me.ctlListView.ListItems
If ctl.Selected Then
MsgBox "Row is Selected " & ctl.Value
End If
Next ctl
End Sub

>Thanks a lot for that. But I am asking after multiselect handling in a listVIEW not a listBOX. The method you describe is not available for listviews.
>regards, Jos

Signature

Please Rate the posting if helps you

 
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.