Select All In List Box

raymond3090

Registered User.
Local time
Today, 21:25
Joined
Sep 5, 2002
Messages
43
Hi there,

I have an unbound list box which is populated by a Select statement. I also have a check box, whereby upon clicking, I would like to select all the items in my list box, and de-select all upon un-clicking.

I don't understand how to do this!! I am working in the after update event of the check box, but I don't know how to write the code to select each item.

Regards,
-Ray
 
'Place in AfterUpdate (or Click) event of check box
Dim i As Integer

If CheckBoxName = True Then
For i = 0 To ListBoxName.ListCount - 1
ListBoxName.Selected(i) = True
Next
End If
 
thanks scott!! Just what I needed, wasn't aware of the Selected Property!!

-Ray
 

Users who are viewing this thread

Back
Top Bottom