Home All Groups Group Topic Archive Search About

CheckedListBox Selecting Items

Author
5 Jul 2009 10:22 AM
Jay
I have items in VB6 form ChekedListBox such as:
          Item 1

          Item 2

          Item 3

          Item 4

          Item 5

When I chose item 1 I have to perform function 1 and when I chose item 2 I
have to perform function 2 and if multples items selected also have to
perform those actions and so on.

I need to identify the status of the checklist and to add or remove a
function if the item is checked or unchecked. Collect the checked items and
generate a report for only the selected items to a excel file columns.

Can someone send me a basic code for that please?

Author
5 Jul 2009 6:01 PM
Larry Serflaten
"Jay" <J**@discussions.microsoft.com> wrote

> Can someone send me a basic code for that please?

Who gave you that assignment?

What have you tried?

LFS
Author
5 Jul 2009 6:38 PM
mayayana
If your lisbox is "box" then...

box.SelCount    '-- returns the number of items selected.

If you have the possibility of multiples you can
walk the list like so:

   For i = 0 To (box.ListCount - 1)
      If box.Selected(i) = True Then  '-- if this item is selected then...
         boxitem = filbox.List(i)  '-- boxitem is the text of that list
item.

> Can someone send me a basic code for that please?

  The above snippets show you how to process the listbox
content, but if you want someone else to write all of the
code and then send it to Excel then you'll need to clarify
how much you're willing to pay for the job. :)
Author
7 Jul 2009 4:28 PM
Jeff Johnson
"Jay" <J**@discussions.microsoft.com> wrote in message
news:51F68C5D-5CE4-47C0-8D00-33446FA6AB9D@microsoft.com...

> I need to identify the status of the checklist and to add or remove a
> function if the item is checked or unchecked.

"Add or remove a function"? I don't fully understand that part of your
request (assignment?).