以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助] 忽略提示 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=162928) |
-- 作者:sanny -- 发布时间:2021/4/17 15:21:00 -- [求助] 忽略提示 老师, 以下代码在执行过程中出现如图错误,如何让它不提示,谢谢。Dim int As Integer = 0 For Each r11 As Row In Tables("PriceNew.Pricelist").rows Dim fr As DataRow = DataTables("PriceNew").Find("Status =\'新增\' and FItemID=" & r11("FItemID1") & "") If r11("FPrioritized") = True And fr("Priority") = False \'For Each r As Row In Tables ("ConfirmList") \'If r("FUsed") = True int = int+1 End If Next If Int = 0 msgbox (" ...必须要指定一个优先供应商 !!!") Else xxx xxx xxx End If [此贴子已经被作者于2021/4/17 15:23:07编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/4/17 16:24:00 -- 有错误就应该改正,而不是忽略,否则可能会造成更多的其它错误 示例三 Dim dr As DataRow 如果我们不加上判断,直接: Dim dr As DataRow 一旦订单表并不存在订购数量超过1000的订单,那么Find方法返回Nothing,导致后续代码运行出错。 Dim fr As DataRow = DataTables("PriceNew").Find("Status =\'新增\' and FItemID=" & r11("FItemID1") & "") if fr isnot nothing then |