Sub Allfilter()
Dim strWH As String
strWH = "True"
If IsNull(Me.省份.Column(0)) = False Then
strWH = strWH & " and (" & S & ")"
End If
If IsNumeric(Me.Text9.Value) = True Then
strWH = strWH & " and 年龄>=" & Me.Text9.Value
End If
If IsNumeric(Me.Text11.Value) = True Then
strWH = strWH & " and 年龄<=" & Me.Text11.Value
End If
Me.神秘人信息子窗体.Form.Filter = strWH
Me.神秘人信息子窗体.Form.FilterOn = True
End Sub
Function S() As String
'省份多选函数
Dim i As Long
Dim str As String
str = "False"
For i = 0 To Me.省份.ListCount - 1
If Me.省份.Selected(i) = True Then
str = str & " or 省份='" & Me.省份.Column(0, i) & "'"
End If
Next
S = str
End Function
Private Sub 查找_Click()
Call Allfilter
End Sub
Private Sub 清除筛选_Click()
Me.省份.Value = Null
Call Allfilter
End Sub