此主题相关图片如下:45n)j13c{84o6b~695`06yd.png
Dim dt1 As Date = e.Form.Controls("DateTimePicker1").Value
Dim xh As String = e.Form.Controls("TextBox1").value
If dt1 <> Nothing Then
xh = Format(dt1,"yyyyMMdd")
If xh.StartsWith(xh) = False
Dim max As String
Dim idx As Integer
max = e.DataTable.Compute("Max(提案序号)","日期 = #" & dt1 & "# And [_Identify] <> " & e.DataRow("_Identify")) '取得该天的最大编号
If max > "" Then '如果存在最大编号
idx = CInt(max.Substring(9,3)) + 1 '获得最大编号的后三位顺序号,并加1
Else
idx = 1 '否则顺序号等于1
End If
xh = xh & "-" & Format(idx,"000")
End If
End If