Dim LoadFilter1 As String
With e.Form.Controls ("StartDate")
If .Value IsNot Nothing Then
If LoadFilter1 >"" Then
LoadFilter1 = LoadFilter1 & " And "
End If
LoadFilter1 = LoadFilter1 & "领料日期 >= '" & .Value & "'"
End If
End With
With e.Form.Controls ("EndDate")
If .Value IsNot Nothing Then
If LoadFilter1 >"" Then
LoadFilter1 = LoadFilter1 & " And "
End If
LoadFilter1 = LoadFilter1 & "领料日期 <= '" & .Value & "'"
End If
End With
Dim LoadFilter2 As String
With e.Form.Controls ("StartDate")
If .Value IsNot Nothing Then
If LoadFilter2 >"" Then
LoadFilter2 = LoadFilter2 & " And "
End If
LoadFilter2 = LoadFilter2 & "收纱日期 >= '" & .Value & "'"
End If
End With
With e.Form.Controls ("EndDate")
If .Value IsNot Nothing Then
If LoadFilter2 >"" Then
LoadFilter2 = LoadFilter2 & " And "
End If
LoadFilter2 = LoadFilter2 & "收纱日期 <= '" & .Value & "'"
End If
End With
DataTable("副本表对应的主表名称").LoadFilter = LoadFilter1 & IIF(LoadFilter1 > "" AndAlso LoadFilter2 > ""," and " ,"") & LoadFilter2
DataTable("副本表对应的主表名称").load
If LoadFilter1 > "" Then
Tables("装卸车费管理_Table8").Filter = LoadFilter1
End If
Tables("装卸车费管理_Table8").Sort = "领料日期"
If LoadFilter2 > "" Then
Tables("装卸车费管理_Table11").Filter = LoadFilter2
End If