\'Dim r As Row = Tables("凭证").Current
\'If r IsNot Nothing Then
\'If e.DataTable.Compute("Count(凭证ID)","凭证ID = \'" & r("凭证ID") & "\'") >= 10 Then
\'msgbox("明细行数已满,请新增一张凭证")
\'e.Cancel = True
\'Else
Dim r As Row = Tables(e.form.tablename).AddNew()
\'r("凭证ID") = "TOCW" & Format(Date.now,"yyMMdd-HHmmss")
\'r("规划分类") = e.Form.Controls("ComboBox2").text
r("凭证ID") = e.Form.Controls("凭证ID").text
Tables(e.form.tablename).Sort = "凭证ID DESC"
Dim idx As Integer = Tables(e.form.tablename).FindRow(r.DataRow)
Tables(e.form.tablename).Position = idx
r("日期") = Date.Today()
r("姓名") = User.Name
r("部门") = User.Group
DataTables(e.form.tablename).Save()
\'End If
\'End If