并列窗口的名称和对应的表名相同,并列窗口打开时,窗口中的ComboBox1取值同名表当前行的[案号]列的值。
但是打开并列窗口时弹出:不存在名称为""的窗口
老师看看是什么原因?谢谢!
窗口的afterload代码:
Dim frm As object '判断并列窗口名称
For Each f As WinForm.Form In Forms
If f.Tablename = "main" AndAlso f.opened AndAlso f.FormStyle = 0 Then
Dim tab = f.panel.parent.parent
Dim p = tab.tabpages(tab.Selectedindex)
frm = Forms(p.controls(0).name)
Exit For
End If
Next
If frm IsNot Nothing Then
'msgbox(frm.Name)
Dim bh As String = e.Form.Controls("ComboBox1").text
Dim dr As Row = Tables(frm.Name).Current
bh = dr("案号")
End If