以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  明明使用了判断的语句,怎么还提示这个呢  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=179382)

--  作者:zhuxinhui
--  发布时间:2022/8/20 21:04:00
--  明明使用了判断的语句,怎么还提示这个呢
 If s.Rows(i)("选择") = True Then
图片点击可在新窗口打开查看此主题相关图片如下:dingtalk_20220820205420.jpg
图片点击可在新窗口打开查看
  明明使用了判断的语句,怎么还提示这个呢

--  作者:有点蓝
--  发布时间:2022/8/21 20:34:00
--  
请贴出完整代码


--  作者:zhuxinhui
--  发布时间:2022/8/22 11:30:00
--  
Dim Cols1() As String = {"入库日期", "供应商", "货物名称", "规格", "单位", "数量", "单价", "金额", "会计年度", "物料编码", "单号", "单据类型", "结算单价", "结算金额", "往来编码", "科目编码", "科目", "部门"}
Dim Cols2() As String = {"日期", "供应商", "货物名称", "规格", "单位", "数量", "单价", "含税金额", "会计年度", "物料编码", "单号", "单据类型", "结算单价", "结算金额", "往来编号", "科目编码", "科目", "部门"}
Dim s As Table = Tables("采购开单")
Dim a As Table = Tables("已审采购")

For i As Integer = 0 To s.Rows.count - 1
    If s.Rows(i)("选择") = True Then\'Or s.Rows(i)("会计年度") Is Nothing Then
        Dim s1 As Row = s.Rows(i)
        Dim nr As Row = a.AddNew()
        nr("立帐编码") = Forms("应付立帐").Controls("TextBox2").text\'\'\'\'\'立帐编码
        nr("会计年度") = Forms("应付立帐").Controls("DropBox1").text\'\'\'\'\'\'\'年月
        nr("MA005") = Forms("应付立帐").Controls("TextBox4").text\'\'\'\'\'\'\'\'\'\'供应商名称
        nr("MA006") = Forms("应付立帐").Controls("DropBox3").text\'\'\'\'\'\'\'\'\'\'供应商编码        
        For y As Integer = 0 To Cols1.Length - 1
            nr(Cols2(y)) = s1(Cols1(y))
        Next
        Tables("采购开单").Rows(i).Delete()
    End If
Next

--  作者:SbFox
--  发布时间:2022/8/22 11:35:00
--  
 【选择】 列 改为逻辑列    或者   If s.Rows(i)("选择") = “是” ‘定义的逻辑字符
--  作者:有点蓝
--  发布时间:2022/8/22 11:38:00
--  
For i As Integer = 0 To s.Rows.count - 1
改为
For i As Integer = s.Rows.count - 1 to 0 step -1