How to combine two filters ?

PNGBill

Win10 Office Pro 2016
Local time
Today, 16:40
Joined
Jul 15, 2008
Messages
2,271
This is a carry on from my previous posts regarding filtering with vba
I have searched and tried many examples but can not get them to work.
Here are two filters that both work but each cancels the other.

How can I combine them and have an option to have both criteria filtered??

This works to filter "Resigned"

Private Sub CmdFilterResigned_Click()
On Error GoTo Err_CmdFilterResigned_Click


Me.Filter = "EmpFinished =No"
Me.FilterOn = True

Exit_CmdFilterResigned_Click:
Exit Sub

Err_CmdFilterResigned_Click:
MsgBox Err.Description
Resume Exit_CmdFilterResigned_Click

End Sub

And this works to filter "Negative" Balances.

Private Sub CmdFilterLateFeesOnlyUnpaid_Click()
On Error GoTo Err_CmdFilterLateFeesOnlyUnpaid_Click

If Me.CmdFilterLateFeesOnlyUnpaid.Caption = "Click to Remove Late Fees Only Loans" Then
Me.Filter = "NetLoanBalance >0"
Me.FilterOn = True
Me.CmdFilterLateFeesOnlyUnpaid.Caption = "Click to Include Late Fees Only Loans"
Else
Me.Filter = ""
Me.FilterOn = False
Me.CmdFilterLateFeesOnlyUnpaid.Caption = "Click to Remove Late Fees Only Loans"
End If

Exit_CmdFilterLateFeesOnlyUnpaid_Click:
Exit Sub

Err_CmdFilterLateFeesOnlyUnpaid_Click:
MsgBox Err.Description
Resume Exit_CmdFilterLateFeesOnlyUnpaid_Click

End Sub

Appreciate any assistance.
 
How about:

Me.Filter = "EmpFinished =No AND NetLoanBalance >0"
 
:) Yes, Thanks PBALDY. Looks like just this one simple line does the job.
 

Users who are viewing this thread

Back
Top Bottom