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 / General 2 / May 2008

Tip: Looking for answers? Try searching our database.

Listbox column selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 12 May 2008 02:46 GMT
Hi

How can I get the value of the third column of a multi-select list box?

Thanks

Regards
Tom van Stiphout - 12 May 2008 03:46 GMT
Me.SomeListbox.Column(2)
will return the value in column 3 of the selected row.

-Tom.

>Hi
>
[quoted text clipped - 3 lines]
>
>Regards
Tom Wickerath - 12 May 2008 04:37 GMT
Hi Tom,

> Me.SomeListbox.Column(2)
> will return the value in column 3 of the selected row.

That only works with a single select list box (Multiselect property set to
None). Try something like this, instead:

Function InterateSelections() As Variant
On Error GoTo ProcError

Dim varCategory As Variant

  For Each varCategory In Me.SomeListbox.ItemsSelected()
       Debug.Print Me.lboProjects.Column(2, varCategory)
  Next varCategory
 
ExitProc:
  Exit Function
ProcError:
  MsgBox "Error " & Err.Number & ": " & Err.Description, _
          vbCritical, "Error in InterateSelections Function..."
  Resume ExitProc
End Function


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Me.SomeListbox.Column(2)
will return the value in column 3 of the selected row.

-Tom.
__________________________________________

"John" wrote:

Hi

How can I get the value of the third column of a multi-select list box?

Thanks

Regards
Tom Wickerath - 12 May 2008 04:43 GMT
> Debug.Print Me.lboProjects.Column(2, varCategory)

Of course, you have to use the same list box name in the Debug.Print statement

<shy grin>

Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html

Rate this thread:






 
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.