Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:选择加载筛选

1楼
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
2楼
有点蓝 发表于: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
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.