……
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
DataTables("鸡苗销售").LoadFilter = Filter
DataTables("鸡苗销售").Load()
End If