Foxtable(狐表)用户栏目专家坐堂 → 代码问题


  共有2154人关注过本帖平板打印复制链接

主题:代码问题

帅哥哟,离线,有人找我吗?
爱相随
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
代码问题  发帖心情 Post By:2016/3/10 16:17:00 [只看该作者]

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

 

我的理解运行错误提示的意思是在“投资表”中没有找到[月份]这列,但实际上是有的,而名称完全相同。请老师指导。

 



 回到顶部