If e.DataCol.name="产品图号" Then
Tables("图纸信息表").Filter="产品图号 like '%" & e.DataRow("产品图号") & "%'"
End If
If e.NewValue Is Nothing Then
e.DataRow("名称") = Nothing
e.DataRow("材料") = Nothing
Else
Dim dr As DataRow
dr = DataTables("图纸信息表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 名称 is not null")
If dr IsNot Nothing
e.DataRow("名称") = dr("名称")
End If
dr = DataTables("图纸信息表").Find("产品图号 = '" & e.DataRow("产品图号") & "' and 材料 is not null")
If dr IsNot Nothing
e.DataRow("材料") = dr("材料")
End If
End If
第二个代码是我想加的