Urgent: How to use CheckBoxes in ListBox

M

Mr. T

Hello,

I am going crazy because I try to access the Value of a checkbox. Here is
what I do:

* Create a ListBox control
* Set ListBox.ListStyle to fmListStyleOption
* Set ListBox.MultiSelect to fmMultiSelectMulti

This results in a control with checkboxes in front of all list elements. The
checkboxes can be checked/unchecked with the mouse. However, I cannot out
the code needed to

* read the state of the checkbox
* set the state of the checkbox in code

I have been reading the VBA Help for hours now but could not figure out how
to do this. I am begging for your help.

Cheers,

Oliver
 
B

Bob Phillips

Oliver,

This should get you started

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
MsgBox .List(i) & " is selected"
End If
Next i
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top