以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]条件为空时,Filter如何写(已解决) (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=94108) |
-- 作者:yyzlxc -- 发布时间:2016/12/15 15:05:00 -- [求助]条件为空时,Filter如何写(已解决) 下面代码当bz不为空时运行正常,当bz为空时不能加载,为空表,如何修改能够加载当天本单位的全部数据,请各位老师指教,谢谢!! Dim bz As String = Forms("签到明细").Controls("ComboBox1").Text \'班组 Dim Filter As String If bz = "" Then Filter = "班组 = \'\'" Else"班组 = \'" & bz & "\'" Filter = "班组 = \'" & bz & "\'" End If DataTables("签到明细").LoadFilter = "日期 = \'" & rq & "\' and 单位 = \'" & dw & "\' and (" & Filter1 & ")" DataTables("签到明细").Load [此贴子已经被作者于2016/12/15 15:13:49编辑过]
|
-- 作者:有点色 -- 发布时间:2016/12/15 15:07:00 -- Dim bz As String = Forms("签到明细").Controls("ComboBox1").Text \'班组 Dim Filter As String If bz = "" Then Filter = "1=1" Else Filter = "班组 = \'" & bz & "\'" End If DataTables("签到明细").LoadFilter = "日期 = \'" & rq & "\' and 单位 = \'" & dw & "\' and (" & Filter1 & ")" DataTables("签到明细").Load |
-- 作者:yyzlxc -- 发布时间:2016/12/15 15:14:00 -- 谢谢老师,问题解决,再次感谢!! |