请先把代码改成这样,避免运行的时候出错:
Dim dr As DataRow
Dim dm As DataTable = DataTables("订单主明细")
Dim dl As String = "[部件图号] = '" & e.DataRow("部件图号") & "'"
If e.DataCol.Name = "部件图号" Then
dr = dm.Find(dl & "And [装配进度] <> '已出库'"& "And [计划客户] Is Null")
If dr IsNot Nothing Then
e.DataRow("唯一码") = dr("唯一码")
End If
dm.ReplaceFor("计划客户", 2, "[唯一码] = '" & e.DataRow("唯一码") & "'" )
End If
至于没有引用到数据,一般是本来就不存在符合条件的行,如果你觉得有符合条件的行,但是没有引用到,请具体指出是哪一行。