Dim cbx = e.form.controls("combobox1")
If cbx.items.count > 0 Then
cbx.text = cbx.items(0)
End If
Dim cbx1 = e.form.controls("combobox2")
If cbx1.items.count > 0 Then
cbx1.text = cbx1.items(0)
End If
With Tables("收款凭证_Table1")
For i As Integer = .Rows.count - 1 To 0 Step -1
.Rows(i).Delete
Next
.Fill("select * fro m {财务数据源} where [_Identify] Is Null",False)
e.Form.Controls("rq").BindingField = "窗口1_Table1.日期"
e.Form.Controls("dh").BindingField = "窗口1_Table1.凭证号"
e.Form.Controls("Label5").BindingField = "窗口1_Table1.字号"
.AllowEdit = True
.SetColVisibleWidth("摘要|300|贷方科目|100|明细科目|250|金额|100")
.AddNew(10)
.Cols("贷方科目").DropForm = "科目"
.Cols("金额").GrandTotal = True
.GrandTotal = True
'设合计二字居中方法一
'For Each cl As Col In Tables("月租收费_Table1").Cols '设所有列的数据居中
'cl.TextAlign = TextAlignEnum.Center
'Next
'设合计二字居中方法二
Dim r As Row
For i As Integer = 0 To .Rows.Count(True) - 1 'Count加上参数True
r = .Rows(i,True) 'Rows也需要加上参数True
If r.Level Then '如果是合计行
.Cols("摘要").TextAlign = TextAlignEnum.Center
End If
Next
End With
e.Form.Controls("lry").text = User.name
For Each dt As DataRow In Tables("收款凭证_Table1").DataTable.Select("[贷方科目] Is not null")
dt("字号") = (e.Form.Controls("Label5").text).SubString(0,2)
dt("日期") = e.Form.Controls("rq").text
dt("凭证号") = e.Form.Controls("dh").text
Next
现在收款凭证_Table1的贷方数据无法保存到财务数据源。