Foxtable(狐表)用户栏目专家坐堂 → 求助 按照条件筛选列代码


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

主题:求助 按照条件筛选列代码

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


加好友 发短信
等级:一尾狐 帖子:469 积分:4545 威望:0 精华:0 注册:2013/5/22 15:32:00
  发帖心情 Post By:2016/3/13 0:12:00 [显示全部帖子]

列名不能以数字开头,也不能包含除下划线(_)之外的符号

你可以给列起名 列1_1 , 列1_2 , 列1_3 , 列2_1  ,列2_2 等

用户名分别叫 1, 2 。。。

这样你在项目事件 MainTableChanged 中写入以下代码即可实现你想要的功能



If CurrentTable.Name = "表A" Then
    Select Case user.name
        Case "1"
            For Each c As Col In Tables("表A").Cols
                If c.name.contains("列1_") Then
                    c.visible = True
                Else
                    c.visible = False
                End If
            Next
            
        Case "2"
            For Each c As Col In Tables("表A").Cols
                If c.name.contains("列2_") Then
                    c.visible = True
                Else
                    c.visible = False
                End If
            Next
            
    End Select
End If

 回到顶部