Dim Filter As String With e.Form.Controls("单位名称") If .Value IsNot Nothing Then Filter = "单位名称 = '" & .Value & "'" End If End With With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "子女出生日期 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "子女出生日期 <= #" & .Value & "#" End If End With
Tables("出生").filter = Filter
|