Adding Additional Filter Criteria to Existing Code (1 Viewer)

Zippersabrat

Blah Blah Blah :o)
Local time
Yesterday, 19:26
Joined
May 5, 2010
Messages
31
Hi All,

I am trying to add an additional filter criteria to the below. This is a selection drop-down to filter on [Product Product Type]. I want it to also filter the main form to show only those records where [ActionCmb] is null. I have gone round and round and just cannot get it to work. Any help would be greatly appreciated!

Code:
Private Sub TypeCmb_AfterUpdate()

If TypeCmb <> "All" Then

DoCmd.ApplyFilter "", "[Product Product Type]='" & Me.[TypeCmb].Value & "'"

Else

DoCmd.ApplyFilter "", "[Product Product Type] Like ""*"""

End If

End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:26
Joined
Oct 29, 2018
Messages
21,467
Hi. Have you tried something like?

Code:
DoCmd.ApplyFilter "", "[Product Product Type]='" & Me.[TypeCmb].Value & "' AND [ActionCmb] Is Null"
That's assuming ActionCmb is a field name. Correct?
 

Zippersabrat

Blah Blah Blah :o)
Local time
Yesterday, 19:26
Joined
May 5, 2010
Messages
31
Yes but I swear it threw an error. I must have had an extra quotation mark or a missing one somewhere. Thank you! :)
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:26
Joined
Oct 29, 2018
Messages
21,467
Yes but I swear it threw an error. I must have had an extra quotation mark or a missing one somewhere. Thank you! :)
Hi. Glad to hear it's fixed now. Good luck with your project.
 

Users who are viewing this thread

Top Bottom