Dim Filter As String
With e.Form.Controls("company")
If .Value IsNot Nothing Then
Filter = "公司名称='" & .Value & "'"
End If
End With
With e.Form.Controls("company1")
If .Value <> "全部" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = "退款状态='" & .Value & "'"
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "付款时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "付款时间 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("月度结算").Filter = Filter & " AND [付款时间] Is not null"
End If