不知道您前面是否还有代码,关于 zjl 变量的问题自己调过来:
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 )
Dim zzx As String
zjl = "总经理"
If User.Group="操作者" Then
Dim dr As DataRow
dr = DataTables("员工信息库").Find("姓名= '" & User.Name & "'")
If dr IsNot Nothing Then
DataTables("绩效").LoadFilter ="[考核部门]='" & dr("部门") & "' And [建议考核人] <> '"& zjl & "'"
DataTables("绩效").Load()
End If
Else
If User.group = "管理者" Then
DataTables("绩效").LoadFilter =" [建议考核人] <> '"& zjl & "'"
DataTables("绩效").Load()
Else
messagebox.show("此账户已停用!点击确定后将关闭程序.")
Syscmd.Project.Exit()
End If
End If
If User.Type = UserTypeEnum.User Then
For Each dr As DataRow In DataTables("权限").Select("用户名 = '" & User.Name & "'" )
If dr.IsNull("列名") Then
Tables(dr("表名")).Visible = Not dr("不可见")
Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
Else
Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
End If
Next
End If