Foxtable(狐表)用户栏目专家坐堂 → 子表返回父表时如何才能自动返回到父表的对应行


  共有3141人关注过本帖平板打印复制链接

主题:子表返回父表时如何才能自动返回到父表的对应行

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


加好友 发短信
等级:四尾狐 帖子:810 积分:5250 威望:0 精华:0 注册:2009/2/6 10:38:00
  发帖心情 Post By:2014/9/22 14:36:00 [只看该作者]

以下是引用有点甜在2014-9-22 11:49:00的发言:

 参考代码

 

If e.Table.Current Is Nothing Then Return

For Each ra As Relation In Relations
    If ra.ChildTable.Name = e.Table.Name Then
        Dim filter As String = ""
        filter = ra.ParentColumn.Name & " = '" & e.Table.Current(ra.ChildColumn.Name) & "'"
        Dim r As Integer
        r = Tables(ra.ParentTable.Name).FindRow(filter)
        If r >= 0 Then '如果找到的话
            Tables(ra.ParentTable.Name).Position = r '定位到找到的行.
        End If
    End If
Next

 

 

如果反过来,即返回父表的对应行,当前表是父表的时候,返回子表的时候也能够找到对应行就更好。我测试了,但就是自动关闭软件 


 回到顶部
总数 13 1 2 下一页