Dim d1 As Date = e.Form.Controls("B").Value
Dim d2 As Date = e.Form.Controls("C").Value
Dim cmb As WinForm.ComboBox
cmb = Forms("窗口2").Controls("ComboBox1")
Dim n As Integer = cmb.ComboList.split("|").Length
If cmb.SelectedIndex < n -1 Then
cmb.SelectedIndex = cmb.SelectedIndex + 1
End If
With DataTables("生产记录")
.LoadFilter = "日期>=#" & d1 & "# and 日期<=#" & d2 & "# and 序号 = '" & cmb.text & "'"
.Load()
End With
e.form.controls("E").text = cmb.SelectedIndex+1
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")