在foxtable的帮助中,教了我大概应如何设计一个查询窗口。参考网页http://www.foxtable.com/help/index.html?n=1058.htm
如下图:
但教程示例中使用的都是组合框作为输入筛选条件的控件,我需要一个能用文本框输入筛选条件的。
我添加了文本框并沿用了教程中的代码:
Dim Filter As
String
With
e.Form.Controls("cmbProduct")
If
.Value IsNot
Nothing
Then
Filter = "产品 = '" & .Value &
"'"
End
If
End
With
With e.Form.Controls("cmbCustomer")
If .Value IsNot
Nothing
Then
If Filter > "" Then
Filter = Filter &
" And "
End
If
Filter = Filter & "客户 = '" & .Value
& "'"
End
If
End
With
With e.Form.Controls("cmbEmployee")
If .Value IsNot
Nothing
Then
If Filter >"" Then
Filter = Filter &
" And "
End
If
Filter = Filter & "雇员 = '" & .Value
& "'"
End
If
End
With
!!!!我的问题来了!!!!
用以上的代码做成查询窗口后,使用时必须输入和数据表中完全相同的文字才能筛选出来该列。
我特别想知道,什么样的代码才能让我在查询窗口的文本框中输入“包含的关键字 ”就可以筛选出该列
拜托了,帮我编写一下吧,要把下面这样的代码改成什么样子才行啊。
Dim Filter As String
With e.Form.Controls("cmbProduct")
If .Value IsNot Nothing Then
Filter = "产品 = '" & .Value & "'"
End If
End With
With e.Form.Controls("cmbCustomer")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "客户 = '" & .Value & "'"
End If
End With
With e.Form.Controls("cmbEmployee")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "雇员 = '" & .Value & "'"
End If
End With