Dim Filter As String
With e.Form.Controls("计算机部门")
If .Value IsNot Nothing Then
Filter = "部门 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("IP地址")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "IP地址 like '%" & .Value & "%'"
End If
End With
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
Filter = "外网 like '%" & .Value & "%'"
End If
End With
Tables("主窗体_计算机查询表").Filter = Filter