Dim Filter As String
With e.Form.Controls("部门")
If .Value IsNot Nothing Then
Filter = "部门 = \'" & .Value & "\'"
End If
End With
With e.Form.Controls("SSID号")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "SSID号 = \'" & .Value & "\'"
End If
End With
Tables("主窗体_WIFI").Filter = Filter
If Tables("主窗体_WIFI").rows.count = 0 Then
msgbox("没有数据")
End If