代码如下,请问这个有什么问题吗?
此主题相关图片如下:11.png
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 = "出单单号 = '*" & 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 & "备注 = '*" & 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 & "组别 = '*" & 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 & "进单单号 = '*" & 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