1.这是生成的表
Select [bianhao_ID] As [编号],jieshoudanwei As [接收机构],jieshouren As [接收人],laiyuanjing As [来源机构],[sx_danwei] As [送修单位],[sx_ren] As [送修人],[sx_riqi] As [送修日期],[sx_wuliu] As [送修物流],[sx_wuliu_d] As [送修物流单号],jieshouriqi As [接收日期],[chanpin_xinghao] As [产品型号],pinpai As [品牌],chanpindalei As [产品大类],jixin As [机芯],jihao As [机号],chanpinleibie As [产品类别],zichanshuxing As [资产属性],baoxiuxingzhi As [保修性质],[gz_xianxiang] As [故障现象],beijianxinghao As [屏型号],chuchangriqi As [出厂日期],danjuzhuangtai As [单据状态],[pai_riqi] As [派工日期],[pai_ren] As [派工人],[wx_hj] As [维修环节],weixiuzhuangtai As [维修状态],[wx_ren] As [维修人],beizhu As [备注] From {Main_table} order by bianhao_ID ASC
2.这是查询条件
Dim Filter As String
With e.Form.Controls("jieshou")
If .Value IsNot Nothing Then
Filter = "jieshoudanwei = '" & .Value & "'"
End If
End With
With e.Form.Controls("laiyuan")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "laiyuanjing = '" & .Value & "'"
End If
End With
With e.Form.Controls("danju")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "danjuzhuangtai = '" & .Value & "'"
End If
End With
With e.Form.Controls("weixiu")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "weixiuzhuangtai = '" & .Value & "'"
End If
End With
With e.Form.Controls("chanpin")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "chanpin_xinghao = '" & .Value & "'"
End If
End With
With e.Form.Controls("jihao")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "jihao = '" & .Value & "'"
End If
End With
If e.Form.Controls("sxriqi").Checked = True
With e.Form.Controls("kai")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "sx_riqi >= #" & .Value & "#"
End If
End With
End If
With e.Form.Controls("jieshu")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "sx_riqi <= #" & .Value & "#"
End If
End With
If e.Form.Controls("jieriqi").Checked = True
With e.Form.Controls("kai")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "jieshouriqi >= #" & .Value & "#"
End If
End With
End If
With e.Form.Controls("jieshu")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "jieshouriqi <= #" & .Value & "#"
End If
End With
If e.Form.Controls("pairiqi").Checked = True
With e.Form.Controls("kai")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "pai_riqi >= #" & .Value & "#"
End If
End With
End If
With e.Form.Controls("jieshu")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "pai_riqi <= #" & .Value & "#"
End If
End With
If e.Form.Controls("huiriqi").Checked = True
With e.Form.Controls("kai")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "weixiuriqi >= #" & .Value & "#"
End If
End With
End If
With e.Form.Controls("jieshu")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "weixiuriqi <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("信息追踪_table1").Filter = Filter
End If
3.错误提示
在9楼