1、
Dim dt1 As RibbonMenu.DatePicker = RibbonTabs("功能区").Groups("统计").Items("开始日期输入")
Dim dt2 As RibbonMenu.DatePicker = RibbonTabs("功能区").Groups("统计").Items("结束日期输入")
Dim lbl As WinForm.Label
lbl = e.Form.Controls("统计")
lbl.text="起始日期:" & dt1.value & " 至 结束日期: " & dt2.value & " 共计: " & Tables("产品").Compute("count(_identify)") & " 份 "
2、
Dim dt1 As RibbonMenu.DatePicker = RibbonTabs("功能区").Groups("统计").Items("开始日期输入")
Dim dt2 As RibbonMenu.DatePicker = RibbonTabs("功能区").Groups("统计").Items("结束日期输入")
Dim filter As String = "1=1"
If dt1.value <> noting Then
filter &=" and 日期 >= #" &dt1.value &"#"
End If
If dt2.value <> Nothing Then
filter &= " And 日期<=#" & dt2.value & "#"
End If
Tables("产品").Filter=filter
Forms("统计").Open