Hello,
I'm writing a code to clear all the "search boxes" (unbound text fields, combo boxes etc used to search for records) in my form header. I'm very new to VBA and have mostly been altering example codes to suite my needs. Text fields, combo boxes and check fields are all clearing as expected but not the list box. My guess is that since it is multi-select, I need to clear each item selected individually. But my attempts have been unsuccessful. Below is my current working code (aka without acListBox). How should I modify to clear list boxes?
Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As Control
Dim varItem As Variant
'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
Next
'Remove the form's filter.
Me.FilterOn = False
End Sub