如何在Access中创建基于组合框的记录? [英] How do I bring up a record based on a combobox in Access?

查看:115
本文介绍了如何在Access中创建基于组合框的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MS Access中,我有一个简单的数据输入表单。在屏幕底部,您可以逐步查看记录,并在每次点击时更新表单:



     进入前一个栏http://a.yfrog.com/img62/2654/5ge。 png



我怎样才能从我的表单上的组合框中做到这一点?也就是说,我希望能够快速从列表中选择一个项目,并将表单显示为 项。

解决方案

您可以使用向导将组合框添加到绑定窗体。向导发布的选项之一是根据我在组合框中选择的值在我的表单上查找记录。如果你的表单很复杂,你可能看不到这个选项,在这种情况下创建一个简单的表单来查看向导并生成示例代码 - 并不总是最好的代码,但肯定非常有用。



有一些小事情可能会或可能不会给您带来麻烦,例如,如果用户在不使用组合的情况下移动到记录,组合不会更改为显示新记录,但这很容易在表单的当前事件中修复一些代码。

In MS Access, I have a simple data entry form. At the bottom of the screen, you can step through the records and doing so updates the form with each click:

     access previous next bar http://a.yfrog.com/img62/2654/5ge.png

How can I do that from a combobox on my form? That is, I want to be able to quick-pick an item from a list and have the form show that item.

解决方案

You can use the wizard to add a combobox to your bound form. One of the options the wizard offeres is "Find a record on my form based on the value I select in my combobox". If your form is complex, you may not see this option, in which case create a simple form to see the wizard and generate sample code - not always the best code, but certainly very useful.

There are a few small things that may or may not trouble you, for example, if the user moves to a record without using the combo, the combo does not change to show the new record, but this is very easy to fix with a little code in the current event for the form.

这篇关于如何在Access中创建基于组合框的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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