且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MS Access关键字搜索多个字段

更新时间:2023-11-09 20:58:22

可能有一个更简单的方法(如果任何其他专家想要加权,我很乐意听到它),但我通常做的是检查当前是否有过滤器然后如果有,添加到现有科幻滤波器。所以像这样:
展开 | 选择 | Wrap | 行号


Seth,


我喜欢你的想法。我打算沿着同样的路线提出建议。


从本质上讲,我们是过滤过滤器。


只是不要''试试gefilte fish。


哇它完美无缺。非常感谢!我一直在敲我的头重写这段代码几天没有通过谷歌或堆栈溢出找到任何帮助。你知道我想要什么,并在几分钟内解决我的问题。


所以通过使用创建另一个变量strFilter实际上创建了第二个过滤器,我们可以与Me.Filter进行比较?


我不想花太多时间,但如果你不介意的话我还有另外一个小问题。当我选择字段日期时在我的下拉列表中,是否可以按整个月搜索,例如3月而不是像3/15/18这样的特定日期?


Hey everyone. Essentially, I''d like to search keywords within a filtered set without resetting my first filter.

I currently have a split form with a combo box containing a dropdown of all fields. Next to it is a text box to search keywords based off the field selected. Next to that is my search button.

The code below allows me to search keywords off any single field. If I do a 2nd search, it searches off the original data set resetting the filter. I would like to search within filtered results. For example, i have 5000 records my first search of customer name "Smith" takes me to 10 records. From those 10, I''d like to select another field from my existing drop down list and keyword search to drill down further.

Here is my code (Text35 is the text box and searchlist is the combobox list of field names):

Expand|Select|Wrap|Line Numbers

There may be an easier way (if any of the other experts want to weight in, I would love to hear it), but what I normally do is check to see if there is a filter currently in place and then if there is, add to the existing filter. So something like this:
Expand|Select|Wrap|Line Numbers


Seth,

I like how you think. I was going to suggest along the same lines.

In essence, we are "filtering a filter".

Just don''t try the gefilte fish.


Wow it worked perfectly. Thank you so much! I have been banging my head rewriting this code for a couple days without finding any help through google or on stack overflow. You come along knowing exactly what I want and solve my issue within a couple minutes.

So by using creating another variable strFilter was essentially creating a 2nd filter for us to compare with Me.Filter?

I don''t want to take too much of your time, but I had one other minor question if you didn''t mind. When I choose the field "Date" in my drop down list, is it possible to search by an entire month such as March instead of a specific date like 3/15/18?


登录 关闭
扫码关注1秒登录
MS Access关键字搜索多个字段
发送“验证码”获取 | 15天全站免登陆
上一篇 : :如何在Javascript中生成随机柔和(或更亮)的颜色?下一篇 : 激活虚拟环境不起作用

相关阅读

推荐文章