以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于筛选 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=88794) |
||||
-- 作者:mark96 -- 发布时间:2016/8/9 16:51:00 -- 关于筛选 请问我怎么能用组合框筛选出列名,然后根据这个列名继续筛选数据呢? |
||||
-- 作者:大红袍 -- 发布时间:2016/8/9 17:27:00 -- 参考代码
Dim cs As String = "" |
||||
-- 作者:大红袍 -- 发布时间:2016/8/9 17:30:00 -- 查询代码
Dim cn As String = e.form.controls("ComboBox1").Text |
||||
-- 作者:mark96 -- 发布时间:2016/8/9 17:33:00 --
|
||||
-- 作者:大红袍 -- 发布时间:2016/8/9 18:05:00 -- Dim Filter As String Dim lm As String = Forms("窗口1").Controls("ComboBox1").text 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 With e.Form.Controls("TextBox1") If .Value IsNot Nothing AndAlso lm > "" Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & lm & " >= \'" & .Value & "\'" End If End With If Filter > "" Then Tables("表A").Filter = Filter End If |