以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 选择加载筛选 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=194318) |
-- 作者:15666282205 -- 发布时间:2024/11/28 8:09:00 -- 选择加载筛选 老师,我用下面的代码实现了自动选择,这是个通讯录,登录人可以自己新增,表里有一列“提交人“是登录人的名字。还想加个条件,如果是登录人等于表里的提交人则加载,否则不加载,请您指导。 \'------------------------------任意搜索datatable-------------------------- Dim txt As String = e.Form.Controls("TextBox3").Text Dim tbl As DataTable = Tables("个人通讯录").DataTable If txt = "" Then tbl.loadFilter = "" Else txt = "\'%" & txt & "%\'" tbl.loadFilter = "单位 Like " & txt & " Or 部门或姓名 Like " & txt End If tbl.load |
-- 作者:有点蓝 -- 发布时间:2024/11/28 9:00:00 -- Dim txt As String = e.Form.Controls("TextBox3").Text Dim tbl As DataTable = DataTables("个人通讯录") If txt = "" Then tbl.loadFilter = "登录人=\'" & user.name & "\'" Else txt = "\'%" & txt & "%\'" tbl.loadFilter = "登录人=\'" & user.name & "\' and (单位 Like " & txt & " Or 部门或姓名 Like " & txt & ")" End If tbl.load
|