老师,请教一个问题:窗口1中插入的SQLTable,我想双击SQLTable
(窗口1_Table1)中的记录,弹出的编辑窗口(窗口2)中记录是我双击的那条记录。如何让sqlTable的记录与后台主表记录同步呢?因为我的编辑窗口(窗口2)字段绑定的是主表Table2。
已加载数据定位好像还可以,但未加载数据无法正确定位。代码如下,不知错在哪里?(当前表是Table2的sqlTable(窗口1_Table1),Table2已分页加载)
1 If e.Table.Current
Is Nothing Then '如果Current为Nothing
2 Return '则返回
3 End If
4 Dim wz As Integer
5 Dim dr As DataRow
6 dr =
DataTables("Table2").Find("[编号] = '" &
e.Table.Current("编号") & "' And [日期] = #" &
e.Table.Current("日期") & "#")
7 If dr IsNot
Nothing Then
8 wz =
Tables("Table2").FindRow(dr)
9 If wz >= 0 Then
10 Tables("Table2").Position = wz
11 End If
12 End If
[此贴子已经被作者于2016/11/11 16:05:27编辑过]