同一个窗口中有两个TABLE1,TABLE2。TABLE1和TABLE2中有一个相同的关键列,列名为A。
在Table1中选定某一行,Checked值设为真的时候,自动从TABLE2中选中A列值相同的行,也把Checked值设为真。下面的代码只能选中TABLE2中的一行,有多个行满足条件的时候,不能全部选中。帮忙修改代码
Dim dr As Row =Tables(e.form.name & "_table1").Current
If dr.Checked =True Then
dr.Checked =False
Else
dr.Checked =True
End If
Dim tb2 As Table =Tables(e.form.name & "_table2")
With tb2
Dim r As Integer
r = .Find(dr("A"), .RowSel + 1, "工作号", False, False, True)
If r > - 1 Then '如果找到符合条件的行
.rows(r).Checked = dr.Checked
End If
End With
[此贴子已经被作者于2019/11/19 18:00:17编辑过]