Connecting Tech Pros Worldwide Forums | Help | Site Map

Multiple selection in listbox

Newbie
 
Join Date: Aug 2007
Posts: 3
#1: Aug 18 '07
I am having a controll in my project that is listbox with checkbox style. I like to get all the selected item in a access database or in datagrid. kindly help me to get the vb6 source code.

Moderator
 
Join Date: Oct 2006
Location: Australia
Posts: 7,748
#2: Aug 21 '07

re: Multiple selection in listbox


Quote:

Originally Posted by abhijeetroy

I am having a controll in my project that is listbox with checkbox style. I like to get all the selected item in a access database or in datagrid. kindly help me to get the vb6 source code.

Sorry, can you try to describe in a bit more detail what part of the process you want help with?
hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#3: Aug 21 '07

re: Multiple selection in listbox


Quote:

Originally Posted by abhijeetroy

I am having a controll in my project that is listbox with checkbox style. I like to get all the selected item in a access database or in datagrid. kindly help me to get the vb6 source code.

Make it sure is it list box or list view?

If it listView, try like this way (this is not a exact code)
Expand|Select|Wrap|Line Numbers
  1. For i = 1 to lvName.Listitems.Count
  2.         If lvName.Listitem(i).checked = True Then
  3.                        lvName.Listitem(i).Text
  4.                        lvName.Listitem(i).Subitem(1)
  5.                        lvName.Listitem(i).Subitem(2)
  6.                        lvName.Listitem(i).Subitem(3)
  7.                        ..........................
  8.                        ..........................
  9.                        ..........................
  10.                     <Place your Insert Query here.>
  11.         End If
  12. Next i
Reply