有两个表,通过一列序列号作为关联列。双向关联。
在position change的代码里面都有下面的内容。
表A的:
Dim r As Row = Tables("表A").Current
If r IsNot Nothing Then
Dim fl As String = "orderindification = '" & r("orderindification") & "'"
'r.Load() '加载父行
'LockBaseMainForm() '锁定主窗口
DataTables("表B").RemoveFor(fl) '移除当前订单的订单明细
DataTables("表B").AppendLoad(fl) '追载当前订单的订单明细
' UnLockBaseMainForm() '解锁主窗口
End If
表B 的:
Dim r As Row = Tables("表B").Current
If r IsNot Nothing Then
Dim fl As String = "orderindification= '" & r("orderindification") & "'"
'r.Load() '加载父行
'LockBaseMainForm() '锁定主窗口orderindification
DataTables("表A").RemoveFor(fl) '移除当前订单的订单明细
DataTables("表A").AppendLoad(fl) '追载当前订单的订单明细
' UnLockBaseMainForm() '解锁主窗口
End If
然后在选择一个表的某一行时。就会报错。各种各样的错误。
要么 表A的选中的行数据丢失,要么显示下面的错误。

此主题相关图片如下:11.png