Rss & SiteMap

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

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

标题:这一例中,要加上什么代码才能不出错

1楼
小狐 发表于:2010/10/16 19:26:00

If e.DataCol.Name = "客户" Then
    If e.NewValue = True Then
        Dim a As new SQLCommand
        Dim b As Row = Tables("出库").Current
        Dim c As Double
        a.C
        a.CommandText = " select sum(合计金额) from {出库} where 客户 = '"& b("客户") &"' And  结款 = '未结' "
        c = a.ExecuteScalar
        b("欠款金额") = c
    End If
End If

 


图片点击可在新窗口打开查看此主题相关图片如下:11.jpg
图片点击可在新窗口打开查看
2楼
程兴刚 发表于:2010/10/16 20:14:00

If e.NewValue = True Then
改为:

If e.DataRow.IsNull("客户") = false Then

 

因为客户列不应该是逻辑值,您这是按照帮助文件全盘照搬,没有修改代码!

3楼
程兴刚 发表于:2010/10/16 20:17:00

或者:

If e.DataCol.Name = "客户" Then   

    If e.DataRow.IsNull("客户") Then

         Messagebox.Show("对不起,客户列为空!")
   else

        Dim a As new SQLCommand
        Dim b As Row = Tables("出库").Current
        Dim c As Double
        a.C
        a.CommandText = " select sum(合计金额) from {出库} where 客户 = '"& b("客户") &"' And  结款 = '未结' "
        c = a.ExecuteScalar
        b("欠款金额") = c
    End If
End If

4楼
小狐 发表于:2010/10/16 20:59:00

  e.NewValue = True

我以为 修改后 是true

5楼
czy 发表于:2010/10/19 19:44:00
以下是引用小狐在2010-10-16 20:59:00的发言:

  e.NewValue = True

我以为 修改后 是true

 

呵呵,只有逻辑列才会是true

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

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

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