以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]将成绩表中的数据条件筛选(考试年月、班级等)到成绩加载表 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=136157) |
-- 作者:game178 -- 发布时间:2019/6/9 9:17:00 -- [求助]将成绩表中的数据条件筛选(考试年月、班级等)到成绩加载表 刚接触这个,以前都是用EXCEL 现在成绩表中有很多数据,多次考试的成绩,想条件筛选(如考试年月、班级等)后加载到新表:成绩加载表中去【防止数据改动,也为了后面的统计】 有哪位大大有空帮忙解惑吗? |
-- 作者:有点甜 -- 发布时间:2019/6/9 10:11:00 -- 加上填充的代码即可,如
http://www.foxtable.com/webhelp/scr/0680.htm
http://www.foxtable.com/webhelp/scr/1533.htm
|
-- 作者:y2287958 -- 发布时间:2019/6/9 10:32:00 -- Dim lms As String = "考试性质|考试年月|班级|科类|姓名" Dim Filter As String Dim lst As new List(of String) For i As Integer = 0 To lms.Split("|").Length - 1 Dim s As String = Forms("筛选").Controls("combobox" & i+1).Value If s > "" lst.Add(lms.Split("|")(i) & "=\'" & s & "\'") End If Next Filter = String.join(" and ",lst.ToArray) Dim jb As New SQLJoinTableBuilder("查询表1","成绩表") jb.AddCols("*") jb.Filter = Filter DataTables("成绩加载表").DataRows.Clear Dim f As New Filler f.SourceTable = jb.Build(True) f.DataTable = DataTables("成绩加载表") f.Fill() MainTable = Tables("成绩加载表")
|
-- 作者:game178 -- 发布时间:2019/6/12 12:32:00 -- 以下是引用有点甜在2019/6/9 10:11:00的发言:
加上填充的代码即可,如
http://www.foxtable.com/webhelp/scr/0680.htm
http://www.foxtable.com/webhelp/scr/1533.htm Dim Filter As String With e.Form.Controls("combobox1") If .Value IsNot Nothing Then Filter = "考试性质= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox2") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "考试年月= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox3") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "班级= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox4") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "科类= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox5") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "姓名= \'" & .Value & "\'" End If End With If Filter > "" Then Tables("成绩加载表") .Filter = Filter End If
|
-- 作者:有点甜 -- 发布时间:2019/6/12 12:54:00 -- 在筛选代码的后面,加入填充代码
http://www.foxtable.com/webhelp/scr/0680.htm
http://www.foxtable.com/webhelp/scr/1533.htm
|
-- 作者:game178 -- 发布时间:2019/6/12 16:22:00 -- 放在成绩加载表里面的窗口中,好像没有起到作用,而且第一行还是空白 |
-- 作者:game178 -- 发布时间:2019/6/12 16:24:00 -- Dim Filter As String With e.Form.Controls("combobox1") If .Value IsNot Nothing Then Filter = "考试性质= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox2") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "考试年月= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox3") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "班级= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox4") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "科类= \'" & .Value & "\'" End If End With With e.Form.Controls("combobox5") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter &= "姓名= \'" & .Value & "\'" End If End With If Filter > "" Then Tables("成绩表") .Filter = Filter End If 放在成绩表的窗口中能进行有效筛选 |
-- 作者:有点甜 -- 发布时间:2019/6/12 17:17:00 -- Dim Filter As String With e.Form.Controls("combobox1")
With e.Form.Controls("combobox2")
With e.Form.Controls("combobox3")
With e.Form.Controls("combobox4")
With e.Form.Controls("combobox5") Dim f As New Filler
|