老师帮我看看错在哪
Dim Min As String
Dim max As String
Dim idx As Integer
Dim dr As DataRow
dr = DataTables("断号表").Find("[序号] = '" & e.DataRow("序号") & "'")
If Tables("断号表").Current IsNot Nothing And dr Is Nothing Then
Min = DataTables("断号表").Compute(" Min(序号)")
If Min > "" Then
e.DataRow("序号") = Min
End If
Else
max = e.DataTable.Compute("Max(序号)", "[_Identify] <> " & e.DataRow("_Identify"))
If max > "" Then
idx = CInt(max) + 1
Else
idx = 1
End If
e.DataRow("序号") = Format(idx, "000")
End If
[此贴子已经被作者于2023/6/8 9:47:09编辑过]