以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [讨论]如果文本框是空值,不执行替换,不是这执行替换?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=133749)

--  作者:by0521
--  发布时间:2019/4/19 15:03:00
--  [讨论]如果文本框是空值,不执行替换,不是这执行替换?
Dim cmb5 As WinForm.TextBox = Forms("拼卷二").Controls("TextBox5")
Dim cmb6 As WinForm.TextBox = Forms("拼卷二").Controls("TextBox16")
Dim txt5 As String = cmb5.Value
Dim txt6 As Double = cmb6.Value
If txt5 Is Nothing Then
不执行替换,
ElseIf Len(txt5) > 1 And txt5.Chars(11) = "0" And txt5.Chars(12) = "0" Then
    DataTables("检验").ReplaceFor("备注", "拼出", "[产品批号] = \'"& txt5 &"\'")
    DataTables("检验").ReplaceFor("复查人工检验米数", txt6 , "[产品批号] = \'"& txt5 &"\'")
End If
如果txt5是空值,则不执行替换值, txt5不是空值,那执行替换。
请问不执行替换的语句怎么写呢?

--  作者:有点甜
--  发布时间:2019/4/19 15:07:00
--  

 

不执行替换,那不写代码即可。

 

 


--  作者:by0521
--  发布时间:2019/4/19 15:22:00
--  
但是跳出错误提示框呢。
.NET Framework 版本:2.0.50727.9035
Foxtable 版本:2018.10.9.1
错误所在事件:窗口,拼卷二,Button2,MouseUp
详细错误信息:
未将对象引用设置到对象的实例。

--  作者:by0521
--  发布时间:2019/4/19 15:30:00
--  
检查好了。谢谢