检查一下关键的值:
Messagebox.show("_UserGroup = " & _UserGroup)
MessageBox.show("行数:" & DataTables("权限表").Select("用户组 = '" & _UserGroup & "'" ).Count)
For Each dr As DataRow In DataTables("权限表").Select("用户组 = '" & _UserGroup & "'" )
If dr.IsNull("列名") Then
For Each t As Table In Tables
If t.DataTable.Name = dr("表名") Then
t.Visible = Not dr("不可见")
t.AllowEdit = Not dr("不可编辑")
End If
Next
Else
For Each t As Table In Tables
If t.DataTable.Name = dr("表名") Then
For Each c As Col In t.Cols
If c.Name = dr("列名") Then
c.Visible = Not dr("不可见")
c.AllowEdit = Not dr("不可编辑")
End If
Next
End If
Next
End If
Next