2、凭证表序时账簿datatables有N多页,序时账簿tables每页只设成40行;在"明细账查询"是 希望点击 凭证号时 弹出《凭证窗口》,加载对应凭证数据内容
If e.Col.Name = "凭证号" And e.Row.IsNull("凭证号") = False Then
Dim tabname As String = CurrentTable.Name
Dim dr As Row = Tables(tabname).Current
Dim drr As DataRow = DataTables("序时账簿01").sqlFind("凭证编号= '" & dr("凭证号") & "'")
If drr IsNot Nothing Then
Forms("凭证").Opento("序时账簿01")
Dim fbl As WinForm.Table = Forms("凭证").Controls("Table1")
Dim tbl As Table = fbl.Table
tbl.DataSource = DataTables("序时账簿01")
tbl.SetColVisibleWidth("摘要|100|对方单位|120|项目名称|120|科目一级|80|科目明细|100|借方|90|贷方|90")
tbl.Cols("科目明细").DropForm = "凭证科目选择"
tbl.Filter = "凭证编号 = '" & dr("凭证号") & "'"
Dim Drx As Double
Dim Crx As Double
drx = tbl.DataTable.SQLCompute("Sum(借方)","凭证编号='" & dr("凭证号") & "'")
crx = tbl.DataTable.SQLCompute("Sum(贷方)","凭证编号='" & dr("凭证号") & "'")
Dim LaDr As WinForm.Label = Forms("凭证").Controls("labJF")
Dim LaCr As WinForm.Label = Forms("凭证").Controls("labDF")
Dim Ddx As WinForm.Label = Forms("凭证").Controls("labDX")
ladr.Text = format(drx,"C")
lacr.Text = format(crx,"C")
ddx.Text = "人民币: " & cumoney(drx)
Dim bm As WinForm.Label = Forms("凭证").Controls("labbm")
Dim rq As WinForm.Label = Forms("凭证").Controls("labrq")
Dim vo As WinForm.Label = Forms("凭证").Controls("labvo")
Dim zd As WinForm.Label = Forms("凭证").Controls("labzd")
Dim sh As WinForm.Label = Forms("凭证").Controls("labsh")
Dim Butnadd As WinForm.Button = Forms("凭证").Controls("Butnadd1")
butnadd.Visible = False
bm.Text = drr("部门单位")
rq.Text = format(drr("日期"),"yyyy年MM月dd日")
vo.Text = drr("凭证编号")