以文本方式查看主题

-  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=42832)

--  作者:643561836
--  发布时间:2013/11/23 12:20:00
--  关联表选定行后,切换到相应行
以前在帮助中看到过,不记得在哪里了。
就是表a与表b联系关联,在表a.b中选中了c行,现在切换到表b,自动跳到c行!

--  作者:Bin
--  发布时间:2013/11/23 12:23:00
--  
在关联表的CurrentChanged事件利用tables(X).Find  即可 http://www.foxtable.com/help/topics/0552.htm
--  作者:狐狸爸爸
--  发布时间:2013/11/23 12:43:00
--  

这个更好:

 

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

 


--  作者:狐狸爸爸
--  发布时间:2013/11/23 12:46:00
--  
设置MainTableChanged事件:
 
if MainTable.Name = "表B" Then
  if Tables("表A.表B").Current IsNot Nothing Then
    Dim dr As DataRow = Tables("表A.表B").Current.DataRow
    Dim wz As Integer = Tables("表B").FindRow(dr)
    If wz >= 0 Then
        Tables("表B").Position = wz
    End If
  End If
End If


--  作者:lihe60
--  发布时间:2013/11/23 13:14:00
--  
以下是引用狐狸爸爸在2013-11-23 12:46:00的发言:
设置MainTableChanged事件:
 
if MainTable.Name = "表B" Then
  if Tables("表A.表B").Current IsNot Nothing Then
    Dim dr As DataRow = Tables("表A.表B").Current.DataRow
    Dim wz As Integer = Tables("表B").FindRow(dr)
    If wz >= 0 Then
        Tables("表B").Position = wz
    End If
  End If
End If

这个代码能内置就好了。