Dim dr As DataRow
dr = DataTables("销售明细").AddNew()
dr("时间") = Date.Today
With Tables("销售明细")
.Position = .Position + 1
End With
Dim d As Date = e.Form.Controls("DateTimePicker时间").Value
Dim y As Integer = d.Year
Dim m As Integer = d.Month
Dim Days As Integer = Date.DaysInMonth(y,m)
Dim fd As Date = New Date(y,m,1)
Dim ld As Date = New Date(y,m,Days)
Dim bh As String = Format(d,"yyyyMM")
Dim max As String
Dim idx As Integer
max = DataTables.Compute("Max(编号)","日期 = #" & e.DataRow("日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))
If max >""then
idx = CInt(max.Substring(9,3)) + 1
Else
idx =1
End If
dr("单据编号") = bh & "-" & Format(idx,"000")
老师好
我在按钮的 click中写下这段代码。
但是 max = DataTables.Compute("Max(编号)","日期 = #" & e.DataRow("日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))
这句老是不正确,
我应该用什么词汇来替代 e.datarow呢?