JamieRhysEdwards
New member
- Local time
- Today, 20:16
- Joined
- Mar 26, 2022
- Messages
- 27
Hi All,
I have a check box labelled "Show Retired" which when ticked, I want it to show assets labelled "Retired" and when it's unchecked, to hide them. I cannot quite figure out how this is done however.
This is what I've done so far:
If I apply the filter manually by tapping the down arrow on the column and then deselecting Retired, it works as expected. If I then check Show Retired, it removes the filter as expected.
However, if I then disable (uncheck) Show Retired, I then get a 3464 error which states it's a Data type mismatch in criteria expression.
If I then tap debug, it shows
I have a check box labelled "Show Retired" which when ticked, I want it to show assets labelled "Retired" and when it's unchecked, to hide them. I cannot quite figure out how this is done however.
This is what I've done so far:
Code:
Private Sub chkShowRetired_Click()
If chkShowRetired.Value = True Then
Me.FilterOn = False
Else
Me.Filter = "[AssetCondition] <> 'Retired'"
Me.FilterOn = True
End If
End Sub
If I apply the filter manually by tapping the down arrow on the column and then deselecting Retired, it works as expected. If I then check Show Retired, it removes the filter as expected.
However, if I then disable (uncheck) Show Retired, I then get a 3464 error which states it's a Data type mismatch in criteria expression.
If I then tap debug, it shows
Me.FilterOn = False
is the culprit?