下面的写法是把隐藏代码加到筛选代码后面,我已经试过了,筛选动作就无法执行了,点击筛选按钮没的反应
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
Filter = "乡镇办 = '" & .Value & "'"
End If
End With
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 & "政治面貌 = '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("人员信息表").Filter = Filter
End If
Tables("人员信息表").Filter = "任职状态 <> '离职'" '-----隐藏离职的行