下列代码中请看红色部分应该如何写,如果删除这二条,可以在表中筛选出来,加上的意思是想在DataList1中显示筛选结果,其它的字符型的都可以用,就是时间型无法用
Dim Filter As String
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "离司时间 >= #" & .Value & "#"
dst.RowFilter = 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 & "#"
dst.RowFilter = Filter & "离司时间<= #" & .Value & "#"
End If
End With
With e.Form.Controls("ComboBox9")
If .Value IsNot Nothing Then
Filter = "离司原因= '" & .Value & "'"
dst.RowFilter = "离司原因= '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("调出人员表").Filter = Filter
End If