以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]自定义增加 多行内容复制  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=114753)

--  作者:q2520
--  发布时间:2018/2/21 12:08:00
--  [求助]自定义增加 多行内容复制
Dim r As Row = Tables("岗中").Current
Dim nr As Row = Tables("岗中").InsertNew
For Each c As Col In Tables("岗中").Cols
    nr(c.Name) = r(c.Name)
Next

怎么样修改成  可以随意填写 增加几行    比方说直接增加100行
[此贴子已经被作者于2018/2/21 13:13:08编辑过]

--  作者:新福星
--  发布时间:2018/2/21 13:57:00
--  
Tables("岗中").AddNew(n)  新增n行
--  作者:q2520
--  发布时间:2018/2/21 14:08:00
--  
不行    我要的是可以自己定义 加多少行        还有这个比方N=3   出来的行 还是只有一行复制内容 其他2行是空的


--  作者:新福星
--  发布时间:2018/2/21 15:49:00
--  
Dim r As Row = Tables("岗中").Current
Dim nr As Row
if r isnot nothing then
for i as integer=1 to 3
nr=Tables("岗中").AddNew()
For Each c As Col In Tables("岗中").Cols
    nr(c.Name) = r(c.Name)
Next
next

end if 

--  作者:q2520
--  发布时间:2018/2/21 16:24:00
--  
主要的一个要求是    可以自己随便定义 增加几行   每次不固定增加行数
--  作者:有点甜
--  发布时间:2018/2/21 16:50:00
--  
Dim r As Row = Tables("岗中").Current
Dim nr As Row
If r IsNot Nothing Then
    Dim n As Integer = 1
    InputValue(n, "增加", "增加多少行?")
    For i As Integer=1 To n
        nr=Tables("岗中").AddNew()
        For Each c As Col In Tables("岗中").Cols
            nr(c.Name) = r(c.Name)
        Next
    Next
End If

--  作者:q2520
--  发布时间:2018/2/21 17:07:00
--  
厉害  十分感谢  等你一天了              过年好
--  作者:q2520
--  发布时间:2018/2/21 17:10:00
--  
还一个问题   

If e.datacol.name = "姓名" Then

    Dim fdr As Datarow = DataTables("某表").Find("姓名 = \'" & e.newValue & "\'")

    If fdr is Nothing Then

        msgbox("姓名不准确")

        e.cancel = true

    End If

End If

这个代码的基础上    怎么样能够在输入错误的单元格生成一个有颜色的边框或者背景添加颜色      就是方便知道是哪个错了


--  作者:有点甜
--  发布时间:2018/2/21 21:11:00
--  

回复8楼

 

http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=114684&authorid=0&page=0&star=2