搜索按钮代码? [英] Search Button Code?

查看:74
本文介绍了搜索按钮代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨:


我想问一下:如何编写搜索按钮的(简单)代码。我使用Access 2007& amp; VBA。此按钮将在包含所有员工信息的查询中按名称搜索,如果名称有效,则消息框将显示和显示员工的所有相关信息。



Hi :

I would like to ask about : how can I write the (simplist) code for search button. I''m bignner in using Access 2007 & VBA . This button will search by name in a query which contains all employees informations then if the name is valid, message box will show and disply all the related informations for the employee.

附加文件
电气设备Co [1] .. zip (106.7 KB,1637 views)
Attached Files
electrical equipments Co[1]..zip (106.7 KB, 1637 views)

推荐答案

嗨&欢迎来到 Bytes


我已将您的问题移至Access Questions区域,因为它被错误地发布在Insights(文章)区域。
Hi & Welcome to Bytes!

I''ve moved your question to the Access Questions area as it was mistakenly posted in the Insights (article) area.


@GoodGirl


我不确定你要求的是什么。没有任何关于你所谈论的数据如何存储的信息很难知道。


基本上,你可能想要一个带有控件的表单运营商会输入搜索短语。输入后,您将搜索数据并在必要时发布消息。 DLookup()可能是要使用的功能。


如果没有更多信息,我将无法提供更多帮助。
@GoodGirl
I''m not sure what you''re asking for. It''s hard to know without any information about how the data you''re talking about is stored.

Basically, you''d probably want a form with a control where the operator would enter a search phrase. When entered you would search through the data and put up the message where necessary. DLookup() is probably the function to use.

Without more information I can''t be much more help.


NeoPa


感谢您的回复,您理解我的意思(抱歉不解释)。我想要一个表单(我将其命名为:start :),其中包含一个搜索按钮,该按钮将在q查询中按名称搜索,然后结果将显示为消息框包含有关该员工的信息。


如何使用DLookup()方法,我想将它与详细信息查询一起使用。然后,如果输入名称在查询中有效:信息将来,如果没有,消息框将显示它无效。我怎么做这个比较?



谢谢
NeoPa

Thanks for reply and you understood what I mean (sorry to not explain it). I want a form (which I named it : start : ) which contains a search button which will search by name in q query and then the result will come as a Message Box contains the information about the employee.


How can I use DLookup() method , I want to use it with DetailedInformation query. then if the input name is valid in the query: the information will come, if not message box will show that it''s not valid. how can I do this comparison?



thanks


这篇关于搜索按钮代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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