表A为主表
与表B.C建立关联表,以客户ID为关联列
A.B.C有同名结账逻辑列
希望实现表A结账逻辑列=True则表B.C相关联行结账逻辑列=True
我的代码怎么不行啊?是不是需要用循环语句?用哪个比较好?
DataColchanged:
Dim da as DataRow = e.DataRow
If da("结账") = True Then
e.DataRow.Locked = True
Dim dr as DataRow
dr = DataTables("表B").Find("客户ID = " & da("客户ID"))
dt = DataTables("表C").Find("客户ID = " & da("客户ID"))
dr("结账") = da("结账")
dt("结账") = da("结账")
End If
[此贴子已经被作者于2008-12-7 16:33:59编辑过]
if e.Datacol.name = "结账" then
Dim T as String
Dim dr1,dr2 as DataRow
dr1 = e.DataRow
If dr1("结账") = True Then
If dr1("客户ID") is Nothing Then
MessageBox.Show("请输入客户ID!", "提示")
Else
T = "客户ID = " & dr1("客户ID")
dr1.Locked = True
for each dr2 in DataTables("表B").select(T)
dr2("结账") = True
Next
for each dr2 in DataTables("表C").select(T)
dr2("结账") = True
Next
End If
End If
End If
[此贴子已经被作者于2008-12-7 17:59:24编辑过]