I have a continuous form in access with multiple text boxes that search a table and return the records that meet all the criteria. It has two buttons, one that filters ("searches") and one that clears all the text boxes ("resets"). It has been working flawlessly for months.
Today, this code started displaying, only sometimes, when I hit esc to clear the textboxes:
" Run-time error '2001': you canceled the previous operation."
This is the line that the debugger highlighted:
Me.FilterOn = False
I am not sure why :/ here is all my code for the reset-command button:
Private Sub cmdReset_Click()
Dim ctl As Control
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
Me.FilterOn = False
End Sub
But again, this all was working, and then just started freaking out. I was editing at the time, and the code builder was open, but I was changing the names of labels in the form design view, not messing with the code.
I worried that I was accidentally typing in my code builder instead of in a label, so now the code wasn't recognizing something, but I have been combing and combing and I cannot find anything out of the ordinary/doesn't match up with something.
I have no idea what I am missing or what I did, but any help is MUCH appreciated!
Sarah