Foxtable(狐表)用户栏目专家坐堂 → [求助]切换用户


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

主题:[求助]切换用户

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2013/5/6 15:12:00 [显示全部帖子]

代码无空值判断,而表内那么多空值的表名列名, 不出错就有鬼了吧- -

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2013/5/6 16:32:00 [显示全部帖子]

For Each t As Table In Tables '显示所有表和列
    t.Visible = True
    t.AllowEdit = True
    For Each c As Col In t.Cols
        c.Visible = True
        c.AllowEdit = True
    Next
Next
Tables("授权表").Visible = (User.Type <> UserTypeEnum.User )
If  User.Type = UserTypeEnum.User Then
    For Each dr As DataRow In DataTables("授权表").Select("用户名 = '" & User.Name & "'" )
   If dr("窗口不可见") = 0 Then
              Forms(dr("窗口名")).Show()
Else
              Forms(dr("窗口名")).Close()
End If    

If dr.IsNull("列名") Then
            Tables(dr("表名")).Visible = Not dr("不可见")
            Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
    
    Else if dr.IsNull("表名") = false then

            Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
            Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")            
        End If
    Next
End If


 回到顶部