Dim Filter As String
Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
e.Form.Controls("startdate").value=Dt1
e.Form.Controls("enddate").value=Dt2
Filter ="日期 >= '" & dt1 & "' And 日期 <= '" & dt2 & "' and 单据性质='费用单'"
DataTables("资金收付").loadfilter=filter
DataTables("资金收付").load()
DataTables("资金收付").SysStyles("EmptyArea").BackColor =Color.FromARGB(245,245,245)
Tables("资金收付").SetColVisibleWidth("审核|60|单据号|70|单据性质|60|日期|80|帐户名称|120|贷方金额|60|结算方式|60|单位名称|120|业务员|100|摘要|120")
Tables("资金收付").ExtendLastCol = True
Tables("资金收付").Sort = "日期"
Dim cmb1 As WinForm.ComboBox
cmb1 = Forms("费用管理").Controls("ComboBox1")
cmb1.ComboList = DataTables("资金收付").GetComboListString("帐户名称")
Dim cmb2 As WinForm.ComboBox
cmb2 = Forms("费用管理").Controls("ComboBox2")
cmb2.ComboList = DataTables("资金收付").GetComboListString("单位名称")
If Tables("资金收付").rows.count=0
Tables("资金收付").GrandTotal = False
Else
Tables("资金收付").Cols("贷方金额").GrandTotal = True
Tables("资金收付").GrandTotal = True '显示合计模式
End If