Dim cx1,cx2,cx3,cx4,cx5 As WinForm.ComboBox
Dim cx6 As WinForm.TextBox = e.Form.Controls("模糊搜索")
cx1 = e.Form.Controls("入会年份查询")
cx2 = e.Form.Controls("部门")
cx3 = e.Form.Controls("学院")
cx4 = e.Form.Controls("专业")
cx5 = e.Form.Controls("宿舍")
Dim Filter As String
With cx1
If .Value IsNot Nothing Then
Filter = "入会年份 = '" & .text & "'"
End If
End With
With cx2
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "所属部门 = '" & .text & "'"
End If
End With
With cx3
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "学院 = '" & .text & "'"
End If
End With
With cx4
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "专业 = '" & .text & "'"
End If
End With
With cx5
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "宿舍楼 = '" & .text & "'"
End If
End With
With cx6
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "姓名 like '*" & .text & "*'"
End If
End With
If Filter > "" Then
If e.Form.Controls("在会成员").checked = True Then
Tables("人事资料总览").Filter = Filter & "是否退会 = false"
End If
'If e.Form.Controls("已退会").checked = True Then
'Tables("人事资料总览").Filter = Filter & "是否退会 = true"
'End If
If e.Form.Controls("全部成员").checked = True Then
Tables("人事资料总览").Filter = Filter
End If
End If

此主题相关图片如下:图片1.png
