以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  两列关联的模拟关联这样写对么?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=148617)

--  作者:yfy13338431925
--  发布时间:2020/4/11 10:37:00
--  两列关联的模拟关联这样写对么?
父表的“全宗号”,“老案卷号”与子表的全宗号”,“老案卷号”关联,在父表CurrentChanged下这样写对么?

If Forms("照片档案目录著录界面").Opened() \'一定要判断用于模拟关联表的窗口是否已经打开
    Dim rdo As WinForm.RadioButton = Forms("照片档案目录著录界面").Controls("RadioButton1关联")
    Dim t As Table = Tables("照片档案目录著录界面_Table1")
    If rdo.Checked = True Then
        With Tables("照片档案目录")
            If .Current Is Nothing Then
                t.Filter = "[_Identify] Is Null"
            Else
                t.Filter = "全宗号 = \'" & .Current("全宗号") & "\'"
                t.Filter = "老案卷号 = \'" & .Current("老案卷号") & "\'"
                
                
            End If
        End With
    End If
End If

--  作者:有点蓝
--  发布时间:2020/4/11 11:07:00
--  
                t.Filter = "全宗号 = \'" & .Current("全宗号") & "\'"
                t.Filter = "老案卷号 = \'" & .Current("老案卷号") & "\'"
改为
                t.Filter = "全宗号 = \'" & .Current("全宗号") & "\' and 老案卷号 = \'" & .Current("老案卷号") & "\'"