此主题相关图片如下:1.png
源码:
Dim Filter As String
''统计离退休
With e.Form.Controls("cmbRetire")
If .Value IsNot Nothing Then
Filter = " leaOrRetire= '" & .Value & "'"
End If
End With
''统计党龄
With e.Form.Controls("cmbPartySta")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & " partyStanding= '" & .Value & "'"
End If
End With
''统计职务
With e.Form.Controls("cmbPos")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "retiredPost= '" & .Value & "'"
End If
End With
'
With e.Form.Controls("cmbPoSta")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "politicalStatus= '" & .Value & "'"
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
'
If Filter > "" Then
Tables("person").Filter = Filter
End If
老师,我有2个问题请教您
1、在筛选职务和政治面貌时,选定多个选项,选出来的就是空的?实际不应该是空的
2、需求里面有统计党龄50年以上人员,我有党员这一列 ,通过数值框可以选出50,但是可不可以给出大于,小于,等于三个选项,进行选择