以下是引用Bin在2014-8-28 11:36:00的发言:在
PrepareEdit 事件做禁止编辑限制
http://www.foxtable.com/help/topics/0605.htm
添加一个列作为判断 例如 逻辑列 "锁定" 你可以选择隐藏
PrepareEdit
if e.datarow("锁定") andalso e.datacol.name <> "需求编号" then
e.cancel=true
end if
Tables("需求明细表").Current.Clone
Tables("需求明细表").Current("已提交")= False
Tables("需求明细表").Current("锁定")= True
PrepareEdit代码如下。
If e.Col.name <> "QQ号码" AndAlso e.Col.name <> "附件" AndAlso e.Col.name <> "状态" AndAlso e.Col.name <> "需求描述" Then
If e.Row("已提交") Then
e.cancel=True
End If
End If
If e.Row("克隆") AndAlso e.Col.name <> "需求编号" Then
e.cancel=True
End If
克隆指定行的代码如下。
Tables("需求明细表").Current.Clone
Tables("需求明细表").Current("已提交")= False
Tables("需求明细表").Current("克隆")= True
DataTables.Save()
但是呢我在后台需求明细表查看了一下,发现已提交已打勾,克隆没打勾,说明下面2行代码应该没生效。如附件。
Tables("需求明细表").Current("已提交")= False
Tables("需求明细表").Current("克隆")= True

此主题相关图片如下:已提交克隆.png