以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  引用列出现错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=40463)

--  作者:tungwun
--  发布时间:2013/9/20 21:20:00
--  引用列出现错误
引用列出现错误
图片点击可在新窗口打开查看此主题相关图片如下:image 2.png
图片点击可在新窗口打开查看
订金会运用这代码後 Datacolchanged代码出现错误?
If Tables("收據").Current.Locked = False Then
Dim r As Row = CurrentTable.Current 
Dim r1 As Row = CurrentTable.Current 
r1("订金") = r("總數")
End If




If e.DataCol.Name = "订金" AndAlso e.NewValue <> 0 Then
    If e.OldValue Is Nothing OrElse e.oldValue = 0 OrElse e.OldValue = "" Then
        e.DataRow("餘款") = e.NewValue
    End If
End If


--  作者:有点甜
--  发布时间:2013/9/20 21:34:00
--  
方法一:改一下你的 定金列 的数据类型,你肯定设置成 字符了

方法二:改一下代码

If e.DataCol.Name = "订金" AndAlso e.NewValue <> "" Then
    If e.OldValue Is Nothing OrElse e.oldValue = "" Then
        e.DataRow("餘款") = e.NewValue
    End If
End If
[此贴子已经被作者于2013-9-20 21:36:56编辑过]

--  作者:tungwun
--  发布时间:2013/9/20 22:07:00
--  订金设置成数据类型
方法二 代码都是错误?.NET Framework 版本:2.0.50727.5472
Foxtable 版本:2013.9.6.1
错误所在事件:表,收據,DataColChanged
详细错误信息:
引動過程的目標傳回例外狀況。
Conversion from string "" to type \'Double\' is not valid.
輸入字串格式不正確。

[此贴子已经被作者于2013-9-20 22:08:23编辑过]

--  作者:有点甜
--  发布时间:2013/9/20 22:23:00
--  
 替换原本那段代码啊,亲
--  作者:tungwun
--  发布时间:2013/9/20 22:35:00
--  替换原本那段代码都出现错误
替换原本那段代码都出现错误

方法二

If e.DataCol.Name = "订金" AndAlso e.NewValue <> "" Then
    If e.OldValue Is Nothing OrElse e.oldValue = "" Then
        e.DataRow("餘款") = e.NewValue
    End If
End If


--  作者:有点甜
--  发布时间:2013/9/20 22:38:00
--  
 没理由的,上例子。