Full Version: ***Make all Multi-select items highlighted***
UtterAccess Forums > Microsoft® Access > Access Forms
PaulRuss
I wanted to have a checkbox clicked and then have all the items within the multi-select listbox highlighted. Can any one out there help me out?
Thanks a million ~ Paul
Jack Cowley
CODE
Dim i As Integer
If Me.CheckboxName = True
For i = 0 To YourListBoxNameHere.ListCount - 1
        Me.YourListBoxNameHere.Selected(i) = True
Next i
End if

The code would go in the After Update event of the check box and in the On Current event of the form...if you want the list box highlighted if the check box was selected earlier...
hth,
Jack
accesshawaii
Yes, Try this.
CODE
Dim x As Integer
For x = 0 To Me.YourListBox.ListCount
    Me.YourListBox.Selected(x) = True
Next x
PaulRuss
Thank you Dan & Jack !!!
Can ~ Can I join your "Adults with Obsessive Pinky in the Mouth Syndrome" club? I have the same problem when I try to take over the world sad.gif
Jack ~ What does hth mean, very interesting?
Thanks a million ~ Paul
Jack Cowley
Paul -
Hth = hope this helps
Glad we were able to assist you...
Jack
accesshawaii
We're always looking for new members, Paul.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.