不知道这样对不对,总感觉你要的查询有点问题。
Dim Filter As String
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
Dim s As String = DataTables("明细表").GetComboListString("订单编号",Filter)
s = s.Replace("|","','")
Tables("订单").Filter = "订单编号 in('" & s & "')"
End If
[此贴子已经被作者于2013-4-18 22:22:00编辑过]