以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 筛选 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=70739) |
-- 作者:18664523217 -- 发布时间:2015/6/27 23:32:00 -- 筛选 Dim xm As RibbonMenu.TextBox = RibbonTabs("日常工作").Groups("日常工作").Items("姓名") Dim zc As RibbonMenu.TextBox = RibbonTabs("日常工作").Groups("日常工作").Items("职称") Dim jb As RibbonMenu.TextBox = RibbonTabs("日常工作").Groups("日常工作").Items("级别") Dim bm As RibbonMenu.TextBox = RibbonTabs("日常工作").Groups("日常工作").Items("部门") Dim xb As RibbonMenu.TextBox = RibbonTabs("日常工作").Groups("日常工作").Items("性别") Dim sf As RibbonMenu.TextBox = RibbonTabs("日常工作").Groups("日常工作").Items("身份") Dim Filter As String With xm.Text If xm.Text > "" Then Filter = "姓名 = \'" & xm.Text & "\'" End If End With With zc.Text If zc.Text > "" Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "技术职务 = \'" & zc.Text & "\'" End If End With With jb.Text If jb.Text Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "级别 = \'" & jb.Text & "\'" End If End With With bm.Text If bm.Text > "" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "部门 = \'" & bm.Text & "\'" End If End With With xb.Text If xb.Text >"" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "性别 =\'" & xb.Text & "\'" End If End With With sf.Text If sf.Text >"" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "身份 =\'" & sf.Text & "\'" End If End With If Filter > "" Then Tables("人事信息主表").Filter = Filter End If 帮看看问题出在哪里,执行提示 从字符串“”到类型“Boolean”的转换无效。
|
-- 作者:sloyy -- 发布时间:2015/6/27 23:44:00 -- Dim Filter As String With xm.Text If xm.Text > "" Then Filter = "姓名 = \'" & xm.Text & "\'" messagebox.show(filter) End If End With With zc.Text If zc.Text > "" Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "技术职务 = \'" & zc.Text & "\'" messagebox.show(filter) End If End With With jb.Text If jb.Text Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "级别 = \'" & jb.Text & "\'" messagebox.show(filter) End If End With With bm.Text If bm.Text > "" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "部门 = \'" & bm.Text & "\'" messagebox.show(filter) End If End With With xb.Text If xb.Text >"" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "性别 =\'" & xb.Text & "\'" messagebox.show(filter) End If End With With sf.Text If sf.Text >"" Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "身份 =\'" & sf.Text & "\'" messagebox.show(filter) End If End With If Filter > "" Then Tables("人事信息主表").Filter = Filter messagebox.show(filter) End If 这样你就清楚了
|
-- 作者:18664523217 -- 发布时间:2015/6/28 0:02:00 -- 明白了 谢谢了,之前看到这种测试方法,可是自己没想到。 按照你的发放发现问题了,太感谢了!
|
-- 作者:sloyy -- 发布时间:2015/6/28 0:21:00 -- 不客气,互相学习 |