老师 这个找到问题了
我在 table1 的 currentchanged 的事件里面写入
这个代码删除了 就没报错了,
但我需要用到这个代码控制权限,没看到代码什么问题!
Dim fm1 As WinForm.FileManager = e.Form.Controls("FileManager1")
Dim fm2 As WinForm.FileManager = e.Form.Controls("FileManager2")
Dim dj As WinForm.Label = e.Form.Controls("会议等级")
If e.Table.Current Is Nothing Then
e.Form.Controls("FileManager2").Visible = False
e.Form.Controls("无会议记录").Visible = True
e.Form.Controls("FileManager1").Visible = False
e.Form.Controls("无附件").Visible = True
Return
End If
If e.Form.Controls("会议等级").text = "正常" Then
e.Form.Controls("会议等级").BackColor = Color.green
ElseIf e.Form.Controls("会议等级").text = "重要" Then
e.Form.Controls("会议等级").BackColor = Color.red
Else
e.Form.Controls("会议等级").BackColor = Color.Transparent
End If
If e.Table.Current("参与者") = Vars("user") Then '参与会议的人员 根据 会议记录 有没查看附件
If e.Table.Current.IsNull("发起附件") Then
e.Form.Controls("FileManager1").Visible = False
e.Form.Controls("无附件").Visible = True
Else
e.Form.Controls("FileManager1").Visible = True
e.Form.Controls("无附件").Visible = False
End If
If e.Table.Current.IsNull("会议记录") Then
e.Form.Controls("FileManager2").Visible = False
e.Form.Controls("无会议记录").Visible = True
Else
e.Form.Controls("FileManager2").Visible = True
e.Form.Controls("无会议记录").Visible = False
End If
Else '权限 非 会议人员不能查看附件
e.Form.Controls("FileManager2").Visible = False
e.Form.Controls("无会议记录").Visible = True
e.Form.Controls("FileManager1").Visible = False
e.Form.Controls("无附件").Visible = True
End If
If e.Table.Current("发起者") = Vars("user") Then '发起人可以 添加会议记录及 发起附件
If e.Table.Current("开始时间") > Date.Now Then ' 根据时间判断 时间过了 ,不能添加发起附件
fm1.addcommand.visible = True
Else
fm1.addcommand.visible = False
End If
fm1.OpenCommand.Visible = True
fm1.SaveAsCommand.visible = False
fm1.addcommand.visible = False
fm1.DeleteCommand.Visible = False
fm1.ClearCommand.Visible = False
fm1.managercommand.visible = False
fm1.AddFolderCommand.visible = False
fm2.SaveAsCommand.visible = False
fm2.addcommand.visible = True
fm2.OpenCommand.Visible = True
fm2.DeleteCommand.Visible = False
fm2.ClearCommand.Visible = False
fm2.managercommand.visible = False
fm2.AddFolderCommand.visible = False
Return
ElseIf e.Table.Current("参与者") = Vars("user") Then ' 参与者权限 不能添加附件, 只能查看.
fm1.OpenCommand.visible = True
fm1.DeleteCommand.Visible = False
fm1.ClearCommand.Visible = False
fm1.SaveAsCommand.visible = False
fm1.managercommand.visible = False
fm1.addcommand.visible = False
fm1.AddFolderCommand.visible = False
fm2.OpenCommand.visible = True
fm2.DeleteCommand.Visible = False
fm2.ClearCommand.Visible = False
fm2.SaveAsCommand.visible = False
fm2.managercommand.visible = False
fm2.addcommand.visible = False
fm2.AddFolderCommand.visible = False
Return
End If
[此贴子已经被作者于2015/10/7 12:14:55编辑过]