Dim max As String
Dim idx As Integer
If e.DataCol.Name = "产品名称" Then
If e.DataRow.IsNull("产品名称") Then
e.DataRow("产品编码") = Nothing
Else
e.DataRow("产品编码") = GetPy(e.DataRow("产品名称"), 1)
End If
End If
If e.DataCol.Name = "订货日期" Then
If e.DataRow.IsNull("订货日期") Then
e.DataRow("产品编码") = Nothing
Else
Dim bh As String = e.DataRow("产品编码") & Format(cdate(e.DataRow("订货日期")),"yyyyMMdd")
If e.DataRow("订货编码").StartsWith(bh) = False
If e.DataRow.IsNull("产品编码") Then
max = e.DataTable.Compute("Max(订货编码)","产品编码 is null And 订货日期= #" & e.DataRow("订货日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))
Else
End If
End If
End If
End If