--
调试
If e.DataCol.Name = "材料类型" Then
msgbox(e.DataRow("材料类型") )
msgbox(e.NewValue )
If e.DataRow("材料类型") = "检具"
Dim drm As DataRow
msgbox("[物料名称]= \'" & e.NewValue & "\' And [规格型号]= \'" & e.NewValue & "\' ")
drm = DataTables("检具表").Find("[物料名称]= \'" & e.NewValue & "\' And [规格型号]= \'" & e.NewValue & "\' ", "[_SortKey] Desc" )
If drm IsNot Nothing Then
e.DataRow("现有库存数量") = drm("库存数量")
End If
drm = DataTables("检具表").Find("[物料名称]= \'" & e.DataRow("物料名称") & "\' And [规格型号]= \'" & e.DataRow("规格型号") & "\' ", "[_SortKey] Desc" )