Dim Filter As String With e.Form.Controls("姓名") If .Value IsNot Nothing Then Filter ="姓名 like '%" & .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
|