Filter "This" or "That" on one field. (1 Viewer)

andy1968

Registered User.
Local time
Yesterday, 18:04
Joined
May 9, 2018
Messages
131
I'm trying to use code to filter a form field with the citeria being either one value or the other.



Me.frmSubmittalListSubForm.Form.Filter = "Status<>'Approved'" & "Or Status<>'Resubmitted'"
Me.frmSubmittalListSubForm.Form.FilterOn = True


The code runs, but doesn't filter.


What is my error?
 

isladogs

MVP / VIP
Local time
Today, 01:04
Joined
Jan 14, 2017
Messages
18,186
Try
Code:
Me.frmSubmittalListSubForm.Form.Filter = "Status<>'Approved' Or Status<>'Resubmitted'"

BUT are you sure that's what you want?
I'm not convinced you want OR with two <> signs. This is more likely
Code:
Me.frmSubmittalListSubForm.Form.Filter = "Status<>'Approved' AND Status<>'Resubmitted'"

The 2nd version will only show values not equal to either Approved or Resubmitted so e.g. Pending would be OK
 

andy1968

Registered User.
Local time
Yesterday, 18:04
Joined
May 9, 2018
Messages
131
Great!



I have been struggling with this all day.
 

isladogs

MVP / VIP
Local time
Today, 01:04
Joined
Jan 14, 2017
Messages
18,186
You're welcome
Sometimes it just needs another pair of eyes
 

Users who are viewing this thread

Top Bottom