-- 作者:zpx_2012
-- 发布时间:2012/10/8 13:20:00
--
谢谢两位老师,不是我隐藏了,而是项目事件中的这个代码打开时造成的,
在项目的afteropenProject中用了如下代码:
\'让所有表及列均不可见及不可编辑. For Each t As Table In Tables t.Visible = False t.AllowEdit = False For Each c As Col In t.Cols c.Visible = False c.AllowEdit = False Next Next
但我在用户登陆的代码中又根据权限表让其可查看及编辑如下:
Dim drs As List(Of DataRow) drs = DataTables("授权表").Select("[部门] = \'" & MyGroup & "\' And 角色 in (" & R & ")") If drs.count < 1 Then MessageBox.Show("你还没有被授权,不能查看及编辑任何数据,请联系管理员授权!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.Form.Close() Syscmd.Project.Exit() Else e.Form.Close() For Each dr1 As DataRow In drs If dr1.IsNull("可查看列") = False Then Tables(dr1("表名")).Visible = True End If If dr1.IsNull("可编辑列") = False Then Tables(dr1("表名")).AllowEdit = True End If For Each tb As Table In Tables If tb.name = dr1("表名") Then For Each c As Col In tb.Cols Dim a As String = c.name If dr1("可查看列").contains(a) Then c.Visible = True End If If dr1("可编辑列").contains(a) Then c.AllowEdit = True End If Next End If Next Next \'设置导航 Forms("导航").Open() \'设置权限 End If
而且登陆后“订单”及“订单明细”都有显示正确的数据,只是这个订单主表下面的关联表(订单.订单明细)却没有?
|