JazzEars
There may be other ways, but here is code that I found.
Your list box will be a simple Multi-Select list box. Put a check box on your form. Checking it will select all records, unchecking it will deselect all.
Dim i As Integer
If Yourchkbox Then
For i = 0 To Yourlistbox.ListCount - 1
Yourlistbox.Selected(i) = True
Next i
Else
For i = 0 To Yourlistbox.ListCount - 1
Yourlistbox.Selected(i) = False
Next i
End If
Change Yourchkbox to the name of your check box. Change Yourlistbox to the name of your list box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.