以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 求助筛选代码 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=61758)
|
-- 作者:漂亮美眉vszh
-- 发布时间:2014/12/18 16:03:00
-- 求助筛选代码
想要筛选出第一课时或第二课时、、、,以此类推,他们○×△$的值,代码如何写?目前代码:
Dim khmc As WinForm.TextBox = e.Form.Controls("TextBox5") |
Dim kh As WinForm.TextBox = e.Form.Controls("TextBox7") |
|
|
Dim filter As String |
|
If htah.Value <> "" Then |
If filter > "" Then |
filter = filter & " And " |
End If |
filter = "内含科目 Like \'%" & htah.Text & "%\' " |
End If |
If kh.Value <> "" Then |
If filter > "" Then |
filter = filter & " And " |
End If |
filter = "班级编号 Like \'%" & kh.Text & "%\' " |
End If |
If khmc.Value <> "" Then |
If filter > "" Then |
filter = filter & " And " |
End If |
filter = "学员姓名 Like \'%" & khmc.Text & "%\'" |
End If |
If Filter > "" Then |
Tables("学员选班").Filter = filter |
|
End If |
此主题相关图片如下:1.jpg
此主题相关图片如下:2.png
此主题相关图片如下:3.jpg
|
-- 作者:有点甜
-- 发布时间:2014/12/18 16:09:00
--
例子发上来。
|
-- 作者:漂亮美眉vszh
-- 发布时间:2014/12/18 16:28:00
--
在窗口"点名提示中"
|
-- 作者:有点甜
-- 发布时间:2014/12/18 16:34:00
--
哪个窗口,哪个表,什么效果?
|
-- 作者:有点甜
-- 发布时间:2014/12/18 16:46:00
--
代码
Dim ks As WinForm.TextBox = e.Form.Controls("TextBox1") Dim f As String = "" If ks.Text > "" Then Dim kss() As String = {"第一课时", "第二课时","第三课时"} For Each s As String In kss f &= s & " = \'" & ks.Text & "\' or " Next f = "(" & f.SubString(0, f.Length - 3) & ")" msgbox(f) End If e.Form.Controls("Table3").Table.Filter = f
|
-- 作者:漂亮美眉vszh
-- 发布时间:2014/12/18 17:12:00
--
以下是引用有点甜在2014-12-18 16:46:00的发言:
代码
Dim ks As WinForm.TextBox = e.Form.Controls("TextBox1") Dim f As String = "" If ks.Text > "" Then Dim kss() As String = {"第一课时", "第二课时","第三课时"} For Each s As String In kss f &= s & " = \'" & ks.Text & "\' or " Next f = "(" & f.SubString(0, f.Length - 3) & ")" msgbox(f) End If e.Form.Controls("Table3").Table.Filter = f 甜老师,测试没成功
此主题相关图片如下:5.jpg
我的想法是输入”第一课时“,或第二课时、、然后那一列的值为○×△$的都被筛选出来出来~~
|
-- 作者:有点甜
-- 发布时间:2014/12/18 17:21:00
--
这个意思?
Dim ks As WinForm.TextBox = e.Form.Controls("TextBox1") Dim f As String = "1=1" If ks.Text > "" Then f &= " and " & ks.Text & " in (\'○\', \'×\', \'△\', \'$\')" End If msgbox(f) e.Form.Controls("Table3").Table.Filter = f
|