各位老师好,下面是筛选代码,如果不筛选性别,筛选正常,如果各项同时筛选,则只有性别项起作用,请看看问题出在哪里,谢谢
Dim Filter As String
With e.Form.Controls("县市区")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = "县市区 = '" & .Value & "'"
End If
End With
With e.Form.Controls("乡镇办")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = "乡镇办 = '" & .Value & "'"
End If
End With
With e.Form.Controls("性别")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = "性别 = '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("在职人员信息表").Filter = Filter
End If