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.
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.