我做了和查询的按钮 下面是代码
Dim Filter As String
With e.Form.Controls("分局")
If .Value IsNot Nothing Then
Filter = "所属分局= '" & .Value & "'"
End If
End With
With e.Form.Controls("年度")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "所属年度= '" & .Value & "'"
End If
End With
With e.Form.Controls("名称")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "名称 like '*" & .Value & "*'"
End If
End With
If e.Form.Controls("是").Checked = True ' 如果是否认定选择了"是"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "是否认定= True"
End If
If e.Form.Controls("否").Checked = True ' 如果是否认定选择了"是"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "是否认定= False Or 是否认定 Is Null"
End If
If Filter > "" Then
Tables("亏损明细").Filter = Filter
End If
可是最下面的“否”的按钮好像无法and 就是我选择了分局和年度 但是选中"否"按钮后查出来的还是总的数,根本没筛选上面两个条件!~咋回事啊 一下午了都没解决 谢谢大神啊