以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  模拟关联表的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=119214)

--  作者:manyifuwu
--  发布时间:2018/5/20 14:45:00
--  模拟关联表的问题
Dim t As Table = Tables("窗口2_Table2")
With Tables("客户资料")
    If .Current Is Nothing Then
        t.Filter = "False"
    Else
        t.Filter = "编号 = " & .Current("编号")
    End If
End With
Dim t As Table = Tables("窗口2_Table3")
With Tables("客户资料")
    If .Current Is Nothing Then
        t.Filter = "False"
    Else
        t.Filter = "编号 = " & .Current("编号")
    End If
End With
Dim t As Table = Tables("窗口2_Table4")
With Tables("客户资料")
    If .Current Is Nothing Then
        t.Filter = "False"
    Else
        t.Filter = "客户id = " & .Current("编号")
    End If
End With

通模拟关联,在同一个窗口里有4个关联副表。窗口事件AfterLoad里怎么写呢?谢谢!


--  作者:manyifuwu
--  发布时间:2018/5/20 14:58:00
--  
动态加载子行:If e.Table.Current IsNot Nothing Then
    Dim Filter As String = "编号2 = \'" & e.Table.Current("客户id") & "\'"
    DataTables("员工评分").RemoveFor(Filter)
    DataTables("员工评分").AppendLoad(Filter) \'则追载此订单的派工
End If

If Forms("窗口2").Opened() \'一定要判断用于模拟关联表的窗口是否已经打开
    Dim t As Table = Tables("窗口2_Table3")
    With Tables("成华客户资料")
        If .Current Is Nothing Then
            t.Filter = "False"
        Else
            t.Filter = "编号2 = " & .Current("客户id")
        End If
    End With
End If
这个两个代码是要同时存在吗?


--  作者:有点甜
--  发布时间:2018/5/20 16:43:00
--  

回复1楼

 

Dim t As Table = Tables("窗口2_Table2")
With Tables("客户资料")
    If .Current Is Nothing Then
        t.Filter = "False"
    Else
        t.Filter = "编号 = \'" & .Current("编号") & "\'"
    End If
End With
t = Tables("窗口2_Table3")
With Tables("客户资料")
    If .Current Is Nothing Then
        t.Filter = "False"
    Else
        t.Filter = "编号 = \'" & .Current("编号") & "\'"
    End If
End With
t = Tables("窗口2_Table4")
With Tables("客户资料")
    If .Current Is Nothing Then
        t.Filter = "False"
    Else
        t.Filter = "编号 = \'" & .Current("编号") & "\'"
    End If
End With


--  作者:有点甜
--  发布时间:2018/5/20 16:45:00
--  

回复2楼,看你实际需求,如果删除后无法达到效果,那就写在一起。

 

具体问题做个例子说明。