此主题相关图片如下:qq截图20150820131033.png
比着官方帮助做的,不知道哪里出错了,检查了大半天了
错误描述:当查询条件为 “时间段 + 未提取” 的时候,筛选结果中 “时间段” 这个条件失效了。
Tables("积分记录").ApplyFilter = False
Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "会员卡号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
If e.Form.Controls("RadioButton2").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "提取状态 = True"
End If
If e.Form.Controls("RadioButton3").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "提取状态 = False Or 提取状态 Is Null"
End If
If Filter > "" Then
Tables("积分记录").Filter = Filter
End If