各位大佬,有一个跨表查询引用问题咨询一下。目前有一个主表“工时列表”,这个表里面有数据,然后现在另起了一个表,在这个表里输入筛选的条件,但是输入条件后按下查询按钮,并不会有数据引用过来。帮助看一下我这是查询代码有问题吗?
以下是查询按键代码:
Dim qr As DataRow
Dim r As Row
Dim sd As Date
Dim ed As Date
Dim gc As String
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
gc = e.Form.Controls("TextBox1").text
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
sd = e.Form.Controls("StartDate").Value
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
ed = e.Form.Controls("EndDate").Value
End If
End With
qr = DataTables("工时列表").SQLFind(" [工厂]= '" & gc & "' And [提交日期]=> #" & sd & "# And [提交日期]<= #" & ed & "# ")
If qr IsNot Nothing Then
r("当前进度") = qr("审批进度")
r("采购单号") = qr ("工单号")
r("总工时s") = qr("总工时s")
r("工厂") = qr("工厂")
r("品名") = qr("品名")
r("工单数量") = qr("工单数量")
r("提交日期") = qr("提交日期")
End If