You should have created a toggle button in the form designer (not a standard button). Every control has a generic Name
which Access will set unless you change it -- something like ToggleButton115
. You can then write code within the filter handler like this:
If ToggleButton15 Then
'OR option has been set; change the filter appropriately
Else
'OR option has not been set
End If
NB: This works because the togglebutton's Value
property is True
or False
depending on whether it has been toggled or not. The Value
property is the default property -- the property VBA assumes you want to use when you don't specify a property on an object.
See here for more details.