以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  打开带分页的窗口  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=192511)

--  作者:g1j2h3
--  发布时间:2024/6/27 18:23:00
--  打开带分页的窗口
点击查看按钮后,打开如下图所示的第二个页面,麻烦老师看看我的代码错在哪里
DataTables("出库登记").Save() \'接下来要根据主键查找,必须先保存,因为只有保存后新增行的主键才是有效值。
Dim id As String = e.Form.Controls("Label2").Text
Dim dr As DataRow = DataTables("出库登记").Find("[_Identify] = " & id)
If dr Is Nothing Then
    DataTables("出库登记").AppendLoad("[_Identify] = " & id)
    dr = DataTables("出库登记").Find("[_Identify] = " & id)
Else
    dr.Load()
End If
If dr IsNot Nothing Then
    Dim wz As Integer = Tables("出库登记").FindRow(dr)
    If wz < 0 Then \'如果因为筛选导致此送货单不可见
        Tables("出库登记").Filter = ""
        wz = Tables("出库登记").FindRow(dr)
    End If
    If wz >= 0 Then
        Tables("出库登记").Position = wz
        Forms("库存信息").Open()
        If Forms("库存信息").opened Then
            Dim Bar As WinForm.NavBar
            Bar = e.Form.Controls("NavBar1")
            Bar.SelectedIndex = 1
        End If
    End If
End If
e.Form.Close()

图片点击可在新窗口打开查看此主题相关图片如下:库存信息.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:查看.png
图片点击可在新窗口打开查看



--  作者:有点蓝
--  发布时间:2024/6/27 20:38:00
--  
看不出有什么错。代码执行出什么错误?
--  作者:g1j2h3
--  发布时间:2024/6/27 20:53:00
--  
提示找不到NavBar1的控件
--  作者:有点蓝
--  发布时间:2024/6/27 20:58:00
--  
NavBar是"库存信息"窗口的?

Bar = e.Form.Controls("NavBar1")
改为
Bar = Forms("库存信息").Controls("NavBar1")