以下代码是一个自动查询窗口,希望实现自动查询,但是以下代码的结果是空白,是什么原因?
Dim dtb As New DataTableBuilder("明细账查询")
dtb.AddDef("项目编号", Gettype(String), 100)
dtb.AddDef("项目名称", Gettype(String), 100)
dtb.AddDef("融资日期", Gettype(Date))
dtb.AddDef("截止日期", Gettype(Date))
dtb.AddDef("借款金额", Gettype(Double))
dtb.AddDef("还款金额", Gettype(Double))
dtb.AddDef("借款利息", Gettype(Double))
dtb.AddDef("期限", Gettype(Double))
dtb.AddDef("利率", Gettype(Double))
dtb.Build()
For Each v As String In DataTables("明细账").GetValues("项目编号","账面科目 = '" & e.form.Controls("ComboBox1").text & "' and 账面项目= '" & e.form.Controls("ComboBox2").text & "' and 项目编号 is not null ")
'msgbox(v)
Dim dr1 As DataRow = DataTables("明细账查询").AddNew()
dr1("项目编号") = v
'Dim dr As DataRow = DataTables("明细账").find("项目编号 = '" & v & "'")
'If dr IsNot Nothing Then
'dr1("项目名称") = dr("项目名称")
'End If
Next
Tables("明细账查询_Table1").DataSource = dtb.BuildDataSource()