Rss & SiteMap

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

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

标题:[原创]

1楼
Cloud 发表于:2025/4/9 18:09:00
求大神指点:
     表格有20列,写一个公式将这20列中不为空的单元格数量计算后自动填入单元格中:比如:e.DataRow("积值") = e.DataRow("开号1") + e.DataRow("开号2") + e.DataRow("开号3")
这个积值=开号1,开号2,开号3中不为空的记录数
2楼
Cloud 发表于:2025/4/9 22:41:00
Dim r1 = Tables("澳门六合表").Current("预号1")
If Tables("澳门六合表").Current("预号1") > 0 Then
    r1 = 1
    Dim r2 = Tables("澳门六合表").Current("预号2")
    If Tables("澳门六合表").Current("预号2") > 0 Then
        r2 = 1      
        Dim r3 = Tables("澳门六合表").Current("预号3")
        If Tables("澳门六合表").Current("预号3") > 0 Then
            r3 = 1
            Dim r4 = Tables("澳门六合表").Current("预号4")
            If Tables("澳门六合表").Current("预号4") > 0 Then
                r4 = 1
                Tables("澳门六合表").Current("计数") = r1 + r2 + r3 + r4
            End If
        End If
    End If
End If
这样写这个代码可以实现,但是有点复杂了,怎么写会简单一些,求大神指点一下 ,谢谢
3楼
有点蓝 发表于:2025/4/10 8:50:00
Dim sum As Integer
Dim r As Row = Tables("澳门六合表").Current
If r IsNot Nothing Then
    For Each c As Col In Tables("澳门六合表").cols
        If c.name.StartsWith("预号") AndAlso r.isnull(c.name) = False Then
            sum += 1
        End If
    Next
    r("计数") = sum
End If
4楼
Cloud 发表于:2025/4/10 15:25: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.