这样试试:
If e.DataCol.Name = "熔铸编号" Then
Dim nms() As String = {"合同号","生产批号","客户","合金","状态","分卷A","分卷B","分卷C","分卷D"}
Dim dr As DataRow
dr = DataTables("生产").Find("[熔铸编号] = '" & e.NewValue & "'")
For Each nm As String In nms
If dr IsNot Nothing
e.DataRow(nm) = dr(nm)
Else
e.DataRow(nm) = Nothing
End If
Next
End If
[此贴子已经被作者于2012-9-7 20:08:08编辑过]