在窗口中录入出库明细,录完一条明细后点保存按钮,代码为:with tables("出库表")
.Current.Locked = True
.Current.Save
end with
这样的话当前行就会锁定,但是关闭窗口以后,刚才锁定的行会自动解锁,
窗口的AfterClose事件为:
DataTables("出库表").LoadFilter = "_Identify Is NULL"
DataTables("出库表").Load
DataTables("出库表").AllowEdit = False
BeforeClose事件为:
Dim hasSave As Boolean = True
For Each r As Row In Tables("出库表").Rows
If r.DataRow.RowState <> DataRowState.Unchanged Then
hasSave = False
End If
Next
If not hasSave Then
MessageBox.Show("请保存出库明细!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question)
e.cancel =True
End If
这些代码我测试过,都不会影响行锁定,另外表的表事件中也无与行锁定相关代码
请问各位大神,还可能什么地方对于行锁定有影响呢?
[此贴子已经被作者于2014-8-7 15:05:27编辑过]