Dim cbx1 As WinForm.ComboBox = e.Form.Controls("名称") Dim dtp1 As WinForm.DateTimePicker = e.Form.Controls("起始日期") Dim dtp2 As WinForm.DateTimePicker = e.Form.Controls("结束日期") e.Form.Controls("Table1").Table.Fill("Select '" & dtp1.Value & "至" & dtp2.Value & "' As 入库日期,名称,规格,SUM(数量) As 入库数,单位 From {固定资产入库} WHERE 名称= '" & cbx1.Text & "'AND 入库日期 >= #"& dtp1.Value &"# And 入库日期 <= #"& dtp2.Value &"# GROUP BY 名称,规格,单位", "数据库", True)