如果用窗口表:
在AfterLoad中加入了
Dim Tbl As Table = e.Form.Controls("VoucherTbl").Table
AddHandler Tbl.grid.Paint, AddressOf Grid_Paint
Tbl.Grid.Name = Tbl.Name
在基他表的CurrentChanged 事件中执行代码:
Dim VoucherTbl As Table = e.Form.Controls("VoucherTbl").Table
Dim Filter As String
If e.Table.Current.IsNull("科目编码")=True Then
Filter="1=2"
Else
Filter ="账套编码='" & Vars("MdbId") & "' and 科目编码 like '" & e.Table.Current("科目编码") & "%' And 月=" & Vars("CurYue") & " and 年=" & vars("CurYear")
End If
'msgbox(Filter)
VoucherTbl.StopRedraw
VoucherTbl.DataTable.LoadFilter=Filter
VoucherTbl.DataTable.Load(False)
VoucherTbl.ResumeRedraw
会报错,提示 找不到名称为VoucherTbl 的控件?