Foxtable(狐表)用户栏目专家坐堂 → 表间的赋值问题


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

主题:表间的赋值问题

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/2/27 12:14:00 [显示全部帖子]

可以参考:

 

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

 

 

如果要做成按钮,按钮代码类型:

 

Dim nma() As String = {"A1","A2","A3","A4"} 'A表数据来源列
Dim nmb() As String = {"B1","B2","B3","B4"} 'B表数据接收列
Dim r1 As Row = Tables("表A").Current
Dim r2 As Row = Tables("表B").AddNew
For i As Integer = 0 To nma.Length - 1
    r2(nmb(i)) = r1(nma(i))
Next

 

如果要自动匹配同名列:

 

Dim r1 As Row = Tables("表A").Current
Dim r2 As Row = Tables("表B").AddNew
For Each c As col In Tables("表A").Cols
    If Tables("表B").Cols.Contains(c.name) Then
        r2(c.name) = r1(c.name)
    End If
Next


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/2/27 14:57:00 [显示全部帖子]

Dim r1 As Row = Tables("表A").Current
Dim r2 As Row = Tables("表B").AddNew

Dim r3 As Row = Tables("表C").Current

r2("关联列") =r3("关联列")
For Each c As col In Tables("表A").Cols
    If Tables("表B").Cols.Contains(c.name) Then
        r2(c.name) = r1(c.name)

     End If
Next


 回到顶部