以文本方式查看主题

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

--  作者:yifan3429
--  发布时间:2019/10/16 13:27:00
--  主窗口多次打开

If e.Node.Level = 1 Then
    Forms(e.Node.Text).Open   窗口为主窗口打开的同时打开对应主表,但是离开后再次点击目录树就没有反应了。原因是窗口已经处于打开状态了,如何解决呢

    \'MainTable = Tables(e.Node.Text)
    \'MainTable = Tables(e.form.tablename) \'打开主表
    
Else
    msgbox( e.node.text & "  正在测试 中尚未开放")
End If

--  作者:有点蓝
--  发布时间:2019/10/16 13:50:00
--  
Forms(e.Node.Text).show
MainTable = Tables(窗口的所有者表)

--  作者:yifan3429
--  发布时间:2019/10/17 10:03:00
--  
If e.Node.Level = 1 Then

有些是模式窗口 有些是主窗口,主窗口离开后,再打开就会打不开。那么可否做出判断如果没有窗口名就寻找表 找到就打开它,需要怎么处理呢 

    Forms(e.Node.Text).Open
    \'MainTable = Tables(e.Node.Text)
    \'MainTable = Tables(e.form.tablename) \'打开主表
    
Else
    msgbox( e.node.text & "  正在测试 中尚未开放")
End If

--  作者:有点蓝
--  发布时间:2019/10/17 10:20:00
--  
模式,独立窗口不要设置所有者表,然后利用这个判断

if Forms(e.Node.Text).TableName > "" then \'不是模式,独立窗口
Forms(e.Node.Text).show
MainTable = Tables(Forms(e.Node.Text).TableName)
else
Forms(e.Node.Text).show
end if

--  作者:yifan3429
--  发布时间:2019/10/17 12:02:00
--  
If e.Node.Level = 1 Then

    If Forms(e.Node.Text).TableName > "" Then \'不是模式,独立窗口
        Forms(e.Node.Text).show
        MainTable = Tables(Forms(e.Node.Text).TableName)
    Else
        Forms(e.Node.Text).show
    End If
Else
    msgbox( e.node.text & "  正在测试 中尚未开放")
End If

取消所有者表后的,提示错误后就会打开对应的窗口

---------------------------
提示
---------------------------
不存在名称为""的Table!
---------------------------
确定   
---------------------------

[此贴子已经被作者于2019/10/17 12:34:32编辑过]

--  作者:有点蓝
--  发布时间:2019/10/17 13:37:00
--  
上传实例说明