使用文本框而不是ctrl + f搜索记录?访问2010 [英] Searching Records using a text box instead of ctrl+f? Access 2010

查看:79
本文介绍了使用文本框而不是ctrl + f搜索记录?访问2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经在2003年能够做到这一点......但已经有一段时间了。


我希望在表格顶部有一个文本框,允许用户输入资产#来搜索数据库


我知道这是Me.RecordsetClone功能......但对于我的生活 - 它无法让它工作.. ..(我认为大胆的部分是问题... vba autohelp显示这应该是在parens ...但那也没有'工作 - 在线我发现它封装在"但我继续得到一个错误

表达式中的语法错误(缺少运算符)。


我在表单顶部有一个名为search的文本框

我有另一个文本框,名为txtAssetID

然后特定字段在此视图所需的表单上...搜索文本框是我希望用户放置资产的位置#他们想要查找。


现在我们正在使用ctrl + f函数在活动字段上进行搜索...但它看起来s rudamentary ...


这里是我的代码......任何调整都会非常感激!



I used to be able to do this in 2003... but it has been a while.

I want a text box at the top of the form that will allow the user to type in an asset# to search the database

I know this is the Me.RecordsetClone feature... but for the life of me - it cannot get it to work.... (I think the bold part is the problem... vba autohelp shows this is supposed to be in parens... but that didnt'' work either - online i found it encapsulated in "" but i keep getting an error of
Syntax error (missing operator) in expression.

I have a text box at top of form called searching
I have another text box which is called txtAssetID
then the specific fields are on the form that are needed for this view... the searching text box is where I want the user to put the asset# they want to look up.

right now we are using the ctrl+f function to do a search on the active field... but it looks rudamentary...

here is the code i have... any tweaks would be most appreciated!



展开 | 选择 | Wrap | 行号

推荐答案

1)我认为你希望资产ID实际上等于某种东西,所以你需要平等。

2)txtAssetID可能是表单上的变量或控件。如果它被引号括起来,那么它就会成为一个字符串,它就不会访问变量/控件的值。

3)如果Asset ID是一个字符串,你需要它用引号括起它与它匹配的值。
1) I think you want the Asset ID to actually equal something so you need to put in equal.
2) txtAssetID is probably a variable or control on the form. If it''s surrounded by quotes, then that makes it a string, it won''t access the value of the variable/control.
3) If Asset ID is a string, you will need to surround the value it is matching to it in quotes.
展开 | 选择 | Wrap | 行号


资产ID是表中的字段名称已填充。


txtAssetID是资产ID表格上的控件。


我已将字段名称更改为AssetID只是为了查看是否空间是问题......仍然无法使用将文本框作为搜索。


我需要做的另一件事是更新找到的记录...我一直看到暗示记录集不可更新的事情......我在一起尝试错误的东西吗?我只是不想让用户使用弹出查找功能...
Asset ID is the field name in the table that is already populated.

txtAssetID is the contorl on the form for Asset ID.

I have changed the field name to AssetID just to see if the space was the issue... and still am unable to use the textbox as the search.

Another thing I need to be able to do is update the record found... i keep seeing things that imply that the recordset is not updateable...am i trying the wrong thing all together? I just don''t want to have the user use the popup find feature...


您没有显示您所做的更改。这是我需要看到的东西,因为根据你的说法,听起来你并没有解决我在帖子中提出的任何问题。


如果记录集不可更新,这是一个不同的问题,应该在另一个帖子中询问。
You haven''t shown the change you made. That is something I need to see because from what you''ve said, it sounds like you didn''t fix any of the issues I brought up in my post.

If the recordset is not updateable, that''s a different question and should be asked in a different thread.


这篇关于使用文本框而不是ctrl + f搜索记录?访问2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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