以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  这一例中,要加上什么代码才能不出错  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=8391)

--  作者:小狐
--  发布时间: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
图片点击可在新窗口打开查看

--  作者:程兴刚
--  发布时间:2010/10/16 20:14:00
--  

If e.NewValue = True Then
改为:

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

 

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


--  作者:程兴刚
--  发布时间: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


--  作者:小狐
--  发布时间:2010/10/16 20:59:00
--  

  e.NewValue = True

我以为 修改后 是true


--  作者:czy
--  发布时间:2010/10/19 19:44:00
--  
以下是引用小狐在2010-10-16 20:59:00的发言:

  e.NewValue = True

我以为 修改后 是true

 

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