Dim d1 As Date = e.Form.Controls("B").Value
Dim d2 As Date = e.Form.Controls("C").Value
Dim s As String = e.Form.Controls("A").Value
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1")
If d1 = Nothing Or d2 = Nothing Then
MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else
With DataTables("生产记录")
.LoadFilter = "日期>=#" & d1 & "# and 日期<=#" & d2 & "# and 配方名称 = '" & s & "'"
.Load()
End With
Dim b As New GroupTableBuilder("统计表5",DataTables("生产记录"))
b.Groups.AddDef("原料名称")
b.Groups.AddDef("序号")
b.Build
MainTable = Tables("统计表5")
cmb.ComboList = DataTables("统计表5").GetComboListString("序号")
End If
Dim mb As WinForm.ComboBox
mb = Forms("窗口2").Controls("ComboBox1")
e.form.controls("D").text = mb.ComboList.split("|").length
Dim d11 As Date = e.Form.Controls("B").Value
Dim d12 As Date = e.Form.Controls("C").Value
Dim s1 As String = e.Form.Controls("A").Value
If d1 = Nothing Or d2 = Nothing Then
MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else
With DataTables("生产记录")
.LoadFilter = "日期>=#" & d11 & "# and 日期<=#" & d12 & "# and 配方名称 = '" & s1 & "'"
.Load()
End With
Dim b1 As New GroupTableBuilder("统计表3",DataTables("生产记录"))
b1.Groups.AddDef("日期")
b1.Groups.AddDef("配方名称")
b1.Groups.AddDef("原料名称")
b1.Groups.AddDef("设定值")
b1.Groups.AddDef("实际值")
b1.Groups.AddDef("误差值")
b1.Groups.AddDef("序号")
b1.Build
MainTable = Tables("统计表3")
' Tables("窗口2_Table1").DataSource = b1.BuildDataSource()
End If
Dim g As New Subtotalgroup
g.GroupOn = "序号"
g.TotalOn = "设定值,实际值,误差值"
With Tables("生产记录")
.SubtotalGroups.Clear()
.SubtotalGroups.Add(g)
.Subtotal() '生成汇总模式
End With