比如用一表,1A列的内容去,二表的2A列查找,找到了以二表中的2B列再去三表中的3A列查询,如果查找到,一表的1C列=三表的D列
我写了一下,出错。
If e.DataCol.Name = "1A" Then
If e.NewValue Is Nothing Then
e.DataRow("1C") = Nothing
Else
Dim ckmx As DataRow
ckmx = DataTables("二表").Find("[2A] = '" & e.NewValue & "'")
If ckmx IsNot Nothing Then
Dim ckbt As DataRow
ckbt = DataTables("三表").Find("[3A] = '" & ckmx("2B") & "'")
If ckbt IsNot Nothing Then
e.DataRow("1C") = ckbt("3D")
Else
e.DataRow("1C") = Nothing
End If
End If
End If
End If
[此贴子已经被作者于2023/10/29 17:41:12编辑过]