Dim Filter As String = "1=1"
With e.Form.Controls("userfin")
If .Value IsNot Nothing Then
Filter = " name = '" & .Value & "'"
End If
End With
Dim f2 As String
With e.Form.Controls("userfin1")
If .Checked = True Then
f2 = "状态 = '未送'"
End If
End With
With e.Form.Controls("ok")
If f2 > "" Then
f2 = f2 & " or "
End If
If .Checked = True Then
f2 &= "状态 = 'ok' "
End If
End With
With e.Form.Controls("new")
If f2 > "" Then
f2 = f2 & " or "
End If
If .Checked = True Then
f2 &= "状态 = '新'"
End If
End With
If f2 > "" Then
Filter = Filter & " and (" & f2 & ")"
End If
With e.Form.Controls("cmbEmployee")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "shangcheng = '" & .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 & "time >= #" & .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 & "time <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("qt2").Filter = Filter
' Tables("weixin").Filter = Filter
End If