Foxtable(狐表)用户栏目专家坐堂 → 复制当前行数据代码出错


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

主题:复制当前行数据代码出错

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


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

改成

 

Dim tp As WinForm.TabControl = e.sender
Select Case tp.SelectedPage.Text
    Case "批量录入"
       
        If Tables("原材料").Rows.Count = 0 Then '如果是一个空表
            Return '那么返回
        End If
        Dim idxs As String = "-1,"
        Dim dr As Row = Tables("原材料").Current
        For Each dc As Col In Tables("原材料").Cols
            For i As Integer = 1 To 4
                Dim nr As Row = Tables("原材料进场录入_Table1").AddNew
                idxs & = nr("_Identify") & ","
                nr(dc.name) = dr(dc.Name)
            Next
        Next
        Tables("原材料进场录入_Table1").filter = "_Identify in (" & idxs.Trim(",") & ")"
End Select


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


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

Dim tp As WinForm.TabControl = e.sender
Select Case tp.SelectedPage.Text
    Case "批量录入"
       
        If Tables("原材料").Rows.Count = 0 Then '如果是一个空表
            Return '那么返回
        End If
        Dim idxs As String = "-1,"
        Dim dr As Row = Tables("原材料").Current
        For i As Integer = 1 To 4
            Dim nr As Row = Tables("原材料进场录入_Table1").AddNew
            idxs & = nr("_Identify") & ","
            For Each dc As Col In Tables("原材料").Cols
                nr(dc.name) = dr(dc.Name)
            Next
        Next
        Tables("原材料进场录入_Table1").filter = "_Identify in (" & idxs.Trim(",") & ")"
End Select

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


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

这个意思

 

Dim tp As WinForm.TabControl = e.sender
Select Case tp.SelectedPage.Text
    Case "批量录入"
        If Tables("原材料").Rows.Count = 0 Then '如果是一个空表
            Return '那么返回
        End If
        Dim idxs As String = "-1,"
        Dim dr As DataRow = Tables("原材料").Current.DataRow
        If dr.RowState = DataRowState.Unchanged Then
            For i As Integer = 1 To 4
                Dim nr As Row = Tables("原材料进场录入_Table1").AddNew
                idxs & = nr("_Identify") & ","
                For Each dc As Col In Tables("原材料").Cols
                    nr(dc.name) = dr(dc.Name)
                Next
            Next
            Tables("原材料进场录入_Table1").filter = "_Identify in (" & idxs.Trim(",") & ")"
        End If
End Select


 回到顶部