Private Sub ClearListBoxes()
Dim i As Integer
Dim ctl As Control
Dim varItem As Variant
For Each ctl In Me.Controls
If ctl.ControlType = acListBox Then
For Each varItem In ctl.ItemsSelected
ctl.Selected(varItem) = False
Next
End If
Next
Set ctl = Nothing
End Sub
By the way, if these are single-select listboxes (the default) then you can just clear them like this:
Code:
Private Sub ClearListBoxes()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acListBox Then
ctl.Value=Null
End If
Next
Set ctl = Nothing
End Sub
Also, you seem to have a "Dim i As Integer" just hanging out there.