以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码报错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=81637)

--  作者:zchlln
--  发布时间:2016/3/2 15:22:00
--  代码报错
For i1 As Integer = 0 To Tables("设备库存明细").Rows.Count - 1
    For i2 As Integer = 0 To Tables("续费表").Rows.Count - 1

        If  Tables("续费表").Rows(i2)("备注 = \'到期未续费不在免费更换周期内,日后更换算新装\' ") 
            Tables("续费表").Rows(i2)("设备ID号") = Tables("设备库存明细").Rows(i1)("设备ID号") Then
            Tables("续费表").Rows(i2)("备注")  = Tables("设备库存明细").Rows(i1)("备注")
        Else
            Continue For
        End If
    Next
Next

备注符合条件 且 设备ID号 设备库存明细中有的 同步备注信息

--  作者:大红袍
--  发布时间:2016/3/2 16:15:00
--  
For i1 As Integer = 0 To Tables("设备库存明细").Rows.Count - 1
    For i2 As Integer = 0 To Tables("续费表").Rows.Count - 1 
        If  Tables("续费表").Rows(i2)("备注") = "到期未续费不在免费更换周期内,日后更换算新装" AndAlso Tables("续费表").Rows(i2)("设备ID号") = Tables("设备库存明细").Rows(i1)("设备ID号") Then
            Tables("续费表").Rows(i2)("备注")  = Tables("设备库存明细").Rows(i1)("备注")
        Else
            Continue For
        End If
    Next
Next

--  作者:大红袍
--  发布时间:2016/3/2 16:15:00
--  

 你最好看一下find函数

 

http://www.foxtable.com/help/topics/0396.htm