Dim zb As WinForm.ComboBox = e.Form.Controls("组别") Dim cddh As WinForm.TextBox = e.Form.Controls("出单单号") Dim jddh As WinForm.TextBox = e.Form.Controls("进单单号") Dim bz As WinForm.TextBox = e.Form.Controls("备注") Dim StartDate As WinForm.DateTimePicker = e.Form.Controls("开始时间") Dim Filter As String With e.Form.Controls("出单单号") If .Value IsNot Nothing Then Filter = "出单单号 like '%" & cddh.Value & "%'" End If End With With e.Form.Controls("备注") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "备注 like '%" & bz.Value & "%'" End If End With With e.Form.Controls("组别") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "组别 like '%" & zb.Value & "%'" End If End With With e.Form.Controls("进单单号") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "进单单号 like '%" & jddh.Value & "%'" End If End With With e.Form.Controls("开时时间") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "要求出单时间 = #" & StartDate .Value & "#" End If End With If Filter > "" Then Tables("进出单表").Filter = Filter End If
|