I have some combo buttons in the form header that people can select to filter data in the subform by selecting an option the clicking a button that has code to filter the data. I have another button with the below code that clears all the filtered controls but it's not working all of a sudden. It's worked for 6 months and now it highlights the text 'ctl.Value = ctl.DefaultValue' in the code and opens the debugger. Any ideas?? TIA
Code:
Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As Control
'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acComboBox, acListBox, acOptionGroup, acTextBox
ctl.Value = ctl.DefaultValue
End Select
Next
'Remove the form's filter.
Me.frmPacsFreeFormSubForm.Form.FilterOn = False
End Sub