以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  根据表A某列的值,自动子表的某一列  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=126200)

--  作者:aza520
--  发布时间:2018/10/16 11:42:00
--  根据表A某列的值,自动子表的某一列
有表A和表B,表B是子表,在同一个窗口显示,其中表A的第一行(第一列值A1)、第二行(第一列值为A2),当我选择表A中第一行时,子表会根据A1值自动隐藏子表的第一列,当我选择表A中第二行时,子表会根据A2值自动隐藏子表的第二列,请问老师,这个功能怎么实现?
--  作者:有点蓝
--  发布时间:2018/10/16 11:58:00
--  
表A,currentchanged事件

dim r as row = e.table.current
if r isnot nothing
    if r("第一列") = "A1" then
        tables("表B").cols("第一列").visible = false
        tables("表B").cols("第二列").visible = true
else
        tables("表B").cols("第一列").visible = true
        tables("表B").cols("第二列").visible = false
endif
end if

--  作者:aza520
--  发布时间:2018/10/16 15:41:00
--  
我想用Select Case语句,比如以下,可是有错,该如何改

Dim r As Row = e.Table.current
If r IsNot Nothing
    Select Case r
        Case "三江县"
            Tables("S房屋明细").cols("政府其它补偿").visible = True
        Case "融水县"
            Tables("S房屋明细").cols("完成时间").visible = True
    End Select
End If

--  作者:有点甜
--  发布时间:2018/10/16 15:57:00
--  

Select Case r

 

改成

 

Select Case r("第一列")