If e.DataCol.Name = "dnd_so" OrElse e.DataCol.Name = "dnd_wo_part" Then
If e.NewValue Is Nothing Then
e.DataRow("dnd_cust") = Nothing
e.DataRow("dnd_cust_part") = Nothing
e.DataRow("dnd_xl") = Nothing
e.DataRow("dnd_xl") = Nothing
e.DataRow("dnd_dy") = Nothing
e.DataRow("dnd_rl") = Nothing
e.DataRow("dnd_zj") = Nothing
e.DataRow("dnd_gd") = Nothing
e.DataRow("dnd_rc") = Nothing
Else
Dim dr As DataRow
dr = DataTables("so_det").Find("(so_cust_dh = '" & e.DataRow("dnd_so") & "') and(so_part = '" & e.DataRow("dnd_wo_part") & "')")
If dr IsNot Nothing Then
e.DataRow("dnd_cust") = dr("so_cust")
e.DataRow("dnd_cust_part") = dr("so_cust_part")
e.DataRow("dnd_xl") = dr("so_xl")
e.DataRow("dnd_dy") = dr("so_dy")
e.DataRow("dnd_rl") = dr("so_rl")
e.DataRow("dnd_zj") = dr("so_zj")
e.DataRow("dnd_gd") = dr("so_gd")
e.DataRow("dnd_rc") = dr("so_pc")
End If
End If
End If
用这个代码解决了,就是不知道怎么简化这个代码,照着帮助手册上简化,运行不成功