使用InputBox打开表单/查找并打开记录 [英] Use InputBox to Open Form/Locate and open Record

查看:118
本文介绍了使用InputBox打开表单/查找并打开记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个打开InputBox的命令按钮。我希望用户输入一个字符串并让InputBox打开一个Form并转到最接近用户字符串的记录。我正在使用以下代码而没有运气:

Hi All,

I have a command button that opens an InputBox. I would like users to enter a string and have the InputBox open a Form and go to the record that matches the users string most closely. I''m using the following code with no luck:

展开 | 选择 | Wrap | 行号

推荐答案

I我不喜欢输入框,因为当我输入错字时我什么都没有,我必须再次开始输入整个字符串。

当你有一套有限的ID'时最好使用向导在表单上查找值来创建组合框。 (向导开始时的第三个选项)

然后输入的值也会自动附加现有值...


当它是LIKE时搜索你可以使用表格的过滤选项来选择匹配行的集合。


想法?


Nic; o)
I don''t like an inputbox as it''s resulting in nothing when I make a typo and I have to start typing the whole string again.
When you have a limited set of ID''s it''s better to create a combobox with the wizard that looks up a value on the form. (Third option when the wizards starts)
Then the entered value is also autoappended with existing values...

When it''s a "LIKE" search you can use the filter option of the form to select the set of matching rows.

Idea ?

Nic;o)



我不喜欢输入框,因为当我输入拼写错误时我什么都没有,我必须开始打字再次使用字符串。

当你拥有一组有限的ID时,最好使用在页面上查找值的向导创建一个组合框。 (向导开始时的第三个选项)

然后输入的值也会自动附加现有值...


当它是LIKE时搜索你可以使用表格的过滤选项来选择匹配行的集合。


想法?


Nic; o)
I don''t like an inputbox as it''s resulting in nothing when I make a typo and I have to start typing the whole string again.
When you have a limited set of ID''s it''s better to create a combobox with the wizard that looks up a value on the form. (Third option when the wizards starts)
Then the entered value is also autoappended with existing values...

When it''s a "LIKE" search you can use the filter option of the form to select the set of matching rows.

Idea ?

Nic;o)



我喜欢这个主意,但我很担心,因为我可能没有有限数量的ID。如果一切顺利,这将是一个临时修复,直到新的计算机系统上线。但是,与所有新系统一样,我预计延迟,问题等 - 在这种情况下,这将不仅仅是一个临时修复。是否还有另一种方法可以让它发挥作用。

I like the idea, but I''m concerned because I may not have a limited number of ID''s. If all goes well, this will be a temporary fix until the new Computer System goes live. However, as with all new systems, I expect delays, problems etc. - in which case this will be more than a temporary fix indefinitely. Is there another option to get this to work.


然后尝试在表单上添加一个文本框,例如:命名为txtFilter并添加一个按钮[搜索]

按钮的OnClick事件中的代码:


''测试字符串被找到

IF len(nz(me.txtFilter))> 0然后

''在表格上设置过滤器

me.filter =" [fieldname to search] like *" &安培; me.txtfilter& " *"

me.filteron = true

else

''" remove"通过停用过滤器

me.filteron = false

endif


得到这个想法?


Nic; o)
Try then an additional textbox on the form, e.g. named txtFilter and add a button [Search]
Code in the OnClick event of the button:

'' test a string is found
IF len(nz(me.txtFilter)) > 0 then
'' set a filter on the form
me.filter = "[fieldname to search] like *" & me.txtfilter & "*"
me.filteron = true
else
'' "remove" the filter by deactivation
me.filteron = false
endif

Getting the idea ?

Nic;o)


这篇关于使用InputBox打开表单/查找并打开记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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