根据文本框中的值显示表单上的记录 [英] Display Record on Form based on value in Text box

查看:77
本文介绍了根据文本框中的值显示表单上的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,


使用Access 2007,但DB是以Access 200o格式创建的,所以我仍然可以使用用户级安全性。


我确信这是一个非常新手的问题。我想在表单中添加一个控件,允许用户键入一个值,在本例中是一个站点#,并让表单导航到相应的记录。


我发现一些使用组合框执行此操作的示例代码。我尝试修改此代码以使用未绑定的文本框但我一直收到运行时错误13类型不匹配错误。


Rec_Num是文本字段。


表格是单一表格。


这是我正在使用的代码:

Good day all,

Using Access 2007 but DB is created in Access 200o format so I can still use User Level security.

I have what am sure is a very newbie question. I want to add a control to a form which allows the user to type in a value, in this case a site #, and have the form navigate to the corresponding record.

I found some sample code that does this using a Combo Box. I tried modifying this code to use an unbound Text Box but I keep getting a runtime error 13 Type Mismatch Error.

Rec_Num is a Text Field.

Form is a Single Form.

Here is the code I am using:

展开 | 选择 | 换行 | 行号

推荐答案


美好的一天,


使用Access 2007但是在Access 200o中创建了数据库格式,所以我仍然可以使用用户级安全。


我有一个非常肯定的东西wbie问题。我想在表单中添加一个控件,允许用户键入一个值,在本例中是一个站点#,并让表单导航到相应的记录。


我发现一些使用组合框执行此操作的示例代码。我尝试修改此代码以使用未绑定的文本框但我一直收到运行时错误13类型不匹配错误。


Rec_Num是文本字段。


表格是单一表格。


这是我正在使用的代码:
Good day all,

Using Access 2007 but DB is created in Access 200o format so I can still use User Level security.

I have what am sure is a very newbie question. I want to add a control to a form which allows the user to type in a value, in this case a site #, and have the form navigate to the corresponding record.

I found some sample code that does this using a Combo Box. I tried modifying this code to use an unbound Text Box but I keep getting a runtime error 13 Type Mismatch Error.

Rec_Num is a Text Field.

Form is a Single Form.

Here is the code I am using:
展开 | 选择 | 换行 | 行号

< br>


在txtFindSite的AfterUpdate()事件中:
In the AfterUpdate() Event of txtFindSite:
展开 | 选择 | Wrap | 行号



感谢您的提示。这会修复运行时错误,但表单不会导航到键入文本框的站点#。


这看起来似乎微不足道。我只是因为用户偏好而这样做。我的大多数人更喜欢从内存中键入站点,而不是滚动浏览组合框中的列表。


文本框是否需要位于表单的特定部分?它目前在Form Header上。
Thank you for the tip. This fixes the runtime error, but the form does not navigate to the Site # that''s keyed into the text box.

This probably seems trivial. I''m only doing this due to user preference. Most of mine prefer to key in Sites from memory rather than scroll through the list in a Combo Box.

Does the Text Box need to be on a particular part of the Form? It is currently on the Form Header.


文本框是否需要位于表单的特定部分?
Does the Text Box need to be on a particular part of the Form?



不,它可以在表格的任何地方。

No, it can be anywhere on the Form.


表单无法导航到网站#,键入文本框。
form does not navigate to the Site # that''s keyed into the text box.



您试图导航到哪个字段,代码中指示的[Rec_Num]或[Site#]?

Which Field are you trying to Navigate to, [Rec_Num] as indicated in your code, or [Site #]?


这篇关于根据文本框中的值显示表单上的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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