Dim Filter As String With e.Form.Controls("姓名1") If .Value IsNot Nothing Then Filter = "姓名 = '" & .Value & "'" End If End With With e.Form.Controls("使用设备1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "使用设备 = '" & .Value & "'" End If End With With e.Form.Controls("开始日期1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "开始日期>= #" & .Value & "#" End If End With With e.Form.Controls("结束日期1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "开始日期<= #" & .Value & "#" End If End With With e.Form.Controls("毛坯编码1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "毛坯编码= '" & .Value & "'" End If End With With e.Form.Controls("生产批次1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "生产批次= '" & .Value & "'" End If End With With e.Form.Controls("批次序号1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "批次序号= '" & .Value & "'" End If End With With e.Form.Controls("加工工序1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "加工工序= '" & .Value & "'" End If End With With e.Form.Controls("班次1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "班次= '" & .Value & "'" End If End With e.Form.controls("生产报工查询表").Table.DataTable.LoadFilter = Filter e.Form.controls("生产报工查询表").Table.DataTable.Load
|