If e.Form.Controls("ComboBox1").Value Is Nothing Then
MessageBox.Show("请输入报表年月")
Return
End If
Dim ym As String = e.Form.Controls("ComboBox1").Value
Dim y As Integer = ym.Substring(0,4)
Dim m As Integer = ym.SubString(4,2)
Dim dt2 As Date = new Date(y,m,25)
Dim dt1 As Date = dt2.AddMonths(-1)
Dim Filter As String = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#"
If user.Group = "填报" Then
filter = filter & " And 单位 = '" & user.name & "'"
End If
DataTables("日报源表").LoadFilter = filter
DataTables("日报源表").Load