搜索多个数据:表单中的文本框和搜索按钮 [英] Search Multiple Data : Textbox and Search Button in Form

查看:136
本文介绍了搜索多个数据:表单中的文本框和搜索按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我有一个可以搜索的代码,只需输入任何关键字。如果我想搜索访问我只能放入Acc,然后它会显示所有包含Acc的记录。在Access,Accelerate等数据库上。


我的问题是。如果我也可以在多次搜索中这样做吗?使用逗号作为分隔符?


例如:我将[Acc,Ex]放在我的文本框中。是否有可能向我显示这样的记录。

?访问

?加速

?准确

?例子

?T-Rex

?Excel


有可能吗?谢谢高级!

解决方案

是的。这是可能的。


您需要使用单独的语句进行ORed,如:

展开 | 选择 | Wrap | 行号

谢谢NeoPa爵士。


BTW我改变了一些你所说的名字。我想出了这个。

LEGEND

•Text24 =文本框,我将输入我想要搜索的值。

•Card_Number =我要搜索的数据存储列的名称。

展开 | 选择 | 换行 | 行号


< blockquote>从根本上说,你做得很好,并准确地发布了你对这个传奇所做的事情,这使你更容易专注于你所做的事情。

  1. 你做的所有替换都很好。然而,第10行(代码的代码)将%F更改为%Me.Text24,这是不必要的。它仍然可以正常工作,但字符串是任意的(只要第一个参数中的子字符串与第二个参数中的字符串匹配,字符串是什么都没关系)。将其保留为%F更容易。
  2. 代码生成过滤器的值。我想这完美无缺。您仍然需要应用过滤器。代码不包括该部分,因为它被认为是被理解的。我会把它包含在这个例子中,假设你希望过滤当前的形式(你没有说你用它做了什么,所以它有意义你不需要解释或说明)。

    展开 | 选择 | Wrap | 行号


    Hi! I had a code that can search, just enter any keyword like. If I want to search "Access" I can put Acc only and then it will show me all record that has "Acc" on the database like Access, Accelerate, etc.

    My question is. It is possible if I also do that in multiple search? Using comma as a separator?

    For example : I will put [Acc, Ex] on my textbox. Is it possible for it to show me the record like.
    ?Access
    ?Accelerate
    ?Accurate
    ?Example
    ?T-Rex
    ?Excel

    Is it possible? Thank you in advanced!

    解决方案

    Yes. It''s possible.

    You would need to do it with separate statements ORed together like :

    Expand|Select|Wrap|Line Numbers


    Thank You Sir NeoPa.

    BTW I changed some names as what you said. I came up with this.

    LEGEND
    • Text24 = Textbox where I will input the value that I want to search.
    • Card_Number = Name of the column where the data stored that I want to search.

    Expand|Select|Wrap|Line Numbers


    Fundamentally you''ve done a great job, and posting exactly what you''ve done with the legend makes it much easier to focus on what you''ve done.

    1. All the replacements you made seem fine. Line #10 (of your code) however, changes %F to %Me.Text24, which is unnecessary. It will still work perfectly, but the string is arbitrary (It doesn''t matter what the string is as long as the substring in the first parameter matches the string in the second one). It''s easier to leave that as %F.
    2. The code produces the value for the filter. I imagine that works perfectly. You still need to apply the filter though. The code doesn''t include that part as it was assumed to be understood. I''ll include it in this example though, on the assumption you wish to filter the current form (You didn''t say what you were doing with it so it made sense you didn''t need that explained or illustrated).

      Expand|Select|Wrap|Line Numbers


    这篇关于搜索多个数据:表单中的文本框和搜索按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆