Dim Filter As String
Tables("进仓明细").Filter = ""
With e.Form.Controls("商品ID")
If .Value IsNot Nothing Then
Filter ="商品ID Like '%" & .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 '%" & .Value & "%'"
End If
End With
Dim jz As WinForm.DateTimePicker = e.Form.Controls("截止日期")
Dim kc As WinForm.DateTimePicker = e.Form.Controls("开始日期")
If kc.Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 > '" & kc.Value & "'"
End If
If jz.Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 < '" & jz.Value & "'"
End If
MessageBox.Show(filter)
If Filter > "" Then
Tables("进仓明细").Filter = Filter
End If