Foxtable(狐表)用户栏目专家坐堂 → 循环语句问题


  共有2166人关注过本帖树形打印复制链接

主题:循环语句问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/5/23 16:39:00 [显示全部帖子]

If User.Group = "行政" Or User.name = "开发者"
    If CurrentTable.name.contains("模具保养")
        For Each r As Row In Tables("生产模数统计").rows
            Dim NY As String = r("年") & r("月")
            If NY.length = 5
                NY = r("年") & "0" & r("月")
            Else
                NY = r("年") & r("月")
            End If
            If r("模具型号") = ""
            Else
                Dim contains As Boolean = False
                For Each dr As DataRow In DataTables("模具保养").DataRows
                    If dr("年月") = NY
                        If dr("模具型号") = r("模具型号")
                            dr("本月生产") = r("生产模数")
                            contains = True
                            Exit For
                        End If
                    End If
                Next
                If contains = False Then
                    Dim dr1 As DataRow
                    dr1 = DataTables("模具保养").AddNew()
                    dr1("模具型号") = r("模具型号")
                    dr1("本月生产") = r("生产模数")                   
                End If
            End If
        Next
    End If
End If

 回到顶部