Foxtable(狐表)用户栏目专家坐堂 → 筛选


  共有2146人关注过本帖树形打印复制链接

主题:筛选

帅哥哟,离线,有人找我吗?
18664523217
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:18 积分:207 威望:0 精华:0 注册:2015/3/9 8:39:00
筛选  发帖心情 Post By: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
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2193 积分:13908 威望:0 精华:2 注册:2012/2/25 10:59:00
  发帖心情 Post By: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
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:18 积分:207 威望:0 精华:0 注册:2015/3/9 8:39:00
明白了  发帖心情 Post By:2015/6/28 0:02:00 [只看该作者]

谢谢了,之前看到这种测试方法,可是自己没想到。
按照你的发放发现问题了,太感谢了!

 回到顶部
帅哥哟,离线,有人找我吗?
sloyy
  4楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2193 积分:13908 威望:0 精华:2 注册:2012/2/25 10:59:00
  发帖心情 Post By:2015/6/28 0:21:00 [只看该作者]

不客气,互相学习

 回到顶部