师傅你好:有A表和B表,下列代码是在B表编号列中输入A表产品编号后,自动输入A表其它需要的数据。现能不能增加代码解决在A表编号列中输入产品编号后,B表编号列自动输入。请师傅帮忙,谢谢!
If e.DataCol.Name = "产品编号" Then
Dim nms() As String = {"品名","型号","规格","单价"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("产品").Find("[产品编号] = '" & e.NewValue & "'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If