Dim s1 As RibbonMenu.ComboBox = RibbonTabs("月末报表").Groups("月末报表").Items("工具栏1").Items("年份")
Dim s2 As RibbonMenu.ComboBox = RibbonTabs("月末报表").Groups("月末报表").Items("工具栏1").Items("月份")
If s1.text = "" OrElse s2.text= "" Then
MessageBox.Show("请填写报表月份后再加载数据!", "提示")
Else
Dim y As integer= s1.text
Dim m As integer= s2.text
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取该月的最后一天
Dim Filter As String
Filter = "((车辆类型 = '外协车' Or 车辆类型 = '外协单位') And (调度日期 >= '" & dt1 & "' And 调度日期 <= '" & dt2 & "')) Or (车辆类型 = '自营车' And (结算日期 >= '" & dt1 & "' And 结算日期 <= '" & dt2 & "'))"
Tables("月末报表").DataTable.loadfilter = Filter
Tables("月末报表").DataTable.load
DataTables("月末报表").DataCols("二次").RaiseDataColChanged()
End If