实在不行,就改成这样
Select Case e.DataCol.Name
Case "型号","规格","皮号"
If e.DataRow.IsNull("皮号") = False AndAlso e.DataRow.IsNull("规格") = False AndAlso e.DataRow.IsNull("型号") = False Then
Dim ls As String
Dim dr As DataRow
dr = DataTables("材料库").Find("皮号 = '" & e.DataRow("皮号") & "'")
If dr IsNot Nothing Then
ls = dr("类属")
e.DataRow("价格") = Nothing
For Each s As String In e.DataRow("规格").Split("+")
dr = DataTables("价格表").Find("(型号 = '" & e.DataRow("型号") & "' And 类属 = '" & ls & "' And 代号 Like '*" & s & "*') Or (型号 = '" & e.DataRow("型号") & "' And 类属 = '" & ls & "' And 规格 = '" & s & "')")
If dr IsNot Nothing Then
e.DataRow("价格") + = dr("价格")
End If
Next
Else
e.DataRow("价格") = Nothing
msgbox("皮号错误,在材料库找不到")
End If
Else
e.DataRow("价格") = Nothing
End If
End Select
[此贴子已经被作者于2014-5-12 20:19:11编辑过]