Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:为什么不计算

1楼
shiliang_010 发表于:2011/9/21 15:03:00

为什么不计算?

If e.DataCol.IsNumeric Then
    If e.NewValue = 0 Then
        e.NewValue = Nothing
    End If
End If


Dim ds As DataTable=DataTables("电量统计表")
Dim dr As DataRow
        '否则在产品表查找同名的产品行,将找到的行赋值给变量dr
        dr = DataTables("电量统计表").Find("[成本费用项目] = '" & e.NewValue & "'")
        If dr IsNot Nothing Then '如果找到了同名的产品行,也就是dr不是Nothing
            e.DataRow("电力_电量") = dr("用电量")
           e.DataRow("电力_金额") = dr("用电金额")
        End If




2楼
狐狸爸爸 发表于:2011/9/21 15:04:00

请将你表传上来,告诉大家在哪个表的哪个事件设置了什么代码,目的是什么,出现了什么问题。

3楼
blackzhu 发表于:2011/9/21 15:07:00

为什么不计算?

Dim dr As DataRow

If e.DataCol.Name ="列名" Then
    If e.Datarow.isNull("列名")Then
        e.Datarow("列名" = Nothing

Else
dr = DataTables("电量统计表").Find("[成本费用项目] = '" & e.NewValue & "'")

 

        If dr IsNot Nothing Then '如果找到了同名的产品行,也就是dr不是Nothing
            e.DataRow("电力_电量") = dr("用电量") 
           e.DataRow("电力_金额") = dr("用电金额")
        End If

end if

end if

4楼
shiliang_010 发表于:2011/9/21 15:17:00

谢谢

 

共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.