If e.DataCol.Name = "分项名称" Then
Dim filter4 As String = "分项名称 = '" & e.DataRow("分项名称") & "' And 年度 = '" & e.DataRow("年度") & "'And 月份 = '" & e.DataRow("月份") & "'"
e.DataRow("本月1") = DataTables("FKB2").Compute("sum(YFKJE)",filter4 ) - DataTables("FKB2").Compute("sum(YFKJE)",filter4 & " and FYDL = '前期费用'") + DataTables("FKB2").Compute("sum(YFKJE)",filter4 & " and FYDL = '测绘'") +DataTables("FKB2").Compute("sum(YFKJE)",filter4 & " and FYDL = '待待费用(开发间接费)'")
e.DataRow("本月3") = DataTables("FKB2").Compute("sum(YFKJE)",filter4 & " and FYDL = '前期费用'") + DataTables("FKB2").Compute("sum(YFKJE)",filter4 & " and FYDL = '测绘'") +DataTables("FKB2").Compute("sum(YFKJE)",filter4 & " and FYDL = '待待费用(开发间接费)'")
End If
老师,这段代码运行没有提示错。但后面的贷码我是在前面代码复制后修改的,运行提示如下错误
Foxtable 版本:2016.3.9.1
错误所在事件:表,投资表, DataColChanged
详细错误信息:
Exception has been thrown by the target of an invocation.
Cannot find column [月份].
修改的代码如下:
If e.DataCol.Name = "XMBM" Then
Dim filter4 As String = "XMBM = '" & e.DataRow("XMBM") & "' And 年度 = '" & e.DataRow("年度") & "'And 月份 = '" & e.DataRow("月份") & "'"
e.DataRow("本月拔款") = DataTables("CZBK2").Compute("sum(BKJE)",filter4 )
e.DataRow("本月投入资金") = DataTables("FKB2").Compute("sum(YFKJE)",filter4 )
e.DataRow("本月国开行") = DataTables("DKFKB").Compute("sum(XFJE)",filter4 )
End If
我的理解运行错误提示的意思是在“投资表”中没有找到[月份]这列,但实际上是有的,而名称完全相同。请老师指导。