If e.DataCol.Name = "物料信息_物料编码" Then
If Tables("表A").current("物料信息_级别") = 1 Then
e.DataRow("物料信息_层级") = e.DataRow("物料信息_物料编码")
End If
End If
If e.DataCol.Name = "物料信息_物料编码" Then
If Tables("表A").current("物料信息_级别") = 2
Dim A As Integer = CurrentTable.Position
Dim t As Table = Tables("表A")
Dim C As Integer = t.Rows(A)("物料信息_级别")
Dim D As Integer = 0
Do While C > 1
If C = 2 Then
D = D+1
End If
A=A-1
C = t.Rows(A)("物料信息_级别")
Loop
e.DataRow("物料信息_层级") = t.Rows(A)("物料信息_物料编码") & "." & D
End If
End If
表的列有 物料信息_级别, 物料信息_层级, 物料信息_物料编码
如果我把第一行,第二行,第三行的 “物料信息_级别"列数字分别输入为 1,2, 2 ,再在“物料信息_物料编码”列中粘贴3个编码,这时,“物料信息_层级“只按 If Tables("表A").current("物料信息_级别") = 1 ”执行。