Dim ddh As WinForm.TextBox = e.Form.Controls("订单号")
Dim cj As WinForm.ComboBox = e.Form.Controls("订单查询厂家筛选")
Dim dj As WinForm.TextBox = e.Form.Controls("单价")
Dim gg As WinForm.TextBox = e.Form.Controls("规格")
Dim filter As String = "1=1"
Dim filter2 As String = "1=1"
If cj.Value <> "厂家筛选" Then
If cj.Value <> "所有客户" Then
filter &= " and 订单客户 = '" & cj.Value & "'"
End If
If ddh.Value > "" Then
filter &= " and 客户订单号 like '%" & ddh.Value & "%'"
End If
If dj.Value > "" Then
filter2 &= " and 单价 = " & dj.Value & ""
End If
If gg.Value > "" Then
filter2 &= " and 型号规格 like '%" & gg.Value.Replace("*", "[*]") & "%'"
End If
Dim ddhs As String = "'" & DataTables("订单明细表").GetComboListString("客户订单号", filter2).Replace("|", "','") & "'"
Tables("查询窗体_订单主表").Filter = filter & " and 客户订单号 in (" & ddhs & ")"
Else
MessageBox.Show("未选择厂家!")
cj.OpenDropDown
End If