Dim Filter As String
With e.Form.Controls("userfin")
If .Value IsNot Nothing Then
Filter = "name = '" & .Value & "'"
End If
End With
With e.Form.Controls("userfin1")
If .Checked = True Then
Filter = "状态 = '未送'"
End If
End With
With e.Form.Controls("ok")
If .Checked = True Then
Filter = "状态 = 'ok' "
End If
End With
With e.Form.Controls("new")
If .Checked = True Then
Filter = "状态 = '新'"
End If
End With
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
此主题相关图片如下:捕获.png
这个图我设计的是 把选择按钮都选上的话,三个相应的结果都能出来才对,
但是现在,如果我选中 两个,或者三个的话,
结果只会 筛选其中的一个,代码如上 麻烦指点一下