-- 作者:lgj716330
-- 发布时间:2018/2/27 14:11:00
-- [求助]索引超出范围
Dim Filter As String = "1=1" \'设置筛选条件 With e.Form.Controls("BM") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "{同期预算}.部门名称 In ( \'" & .Value.replace(",","\',\'") & "\')" End If End With
Dim b As New SQLCrossTableBuilder("统计表1","同期预算") b.AddTable("同期预算","部门名称","责任中心档案","部门名称") b.AddTable("同期预算","科目名称","费用科目档案","科目名称") b.HGroups.AddDef("{同期预算}.科目名称") b.VGroups.AddDef("月份","{0}月") b.Totals.AddDef("预算金额") b.Filter = "{同期预算}.科目名称 not in (\'成本金额\',\'吊牌金额\') and 部门属性 = \'职能部门\' And (" & filter & ")" b.HorizontalTotal = True
b.Build
Tables("预算汇总信息_Table1").DataSource = b.BuildDataSource()
其中 BM控件为CheckedComboBox类型,出现以下错误
此主题相关图片如下:1.png
此主题相关图片如下:2.png
[此贴子已经被作者于2018/2/27 14:55:16编辑过]
|