MS Access 2010中多列组合框自动完成 [英] MS Access 2010 Multi column Combobox Autocomplete

查看:645
本文介绍了MS Access 2010中多列组合框自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在访问一个简单的组合框它作为一个结果集座和包含两列ID和名称。

I have a simple combobox in Access which serves as a result set holder and contains two columns id and name.

我已经开发了一个简单的搜索功能,
在一个文本框和组合框的关键词即用户键入搜索字符串后返回结果,

I have developed a simple search feature, i.e user types in a keyword in a textbox and the combobox returns the results after searching the substring,

例如:

TXT输入框:应用

组合框结果:

ID名称

1   Cinnamon Apple
2   Apple Candy Box
42  Carton of Apples
54  iphone App
6   App Store

现在,当我去到搜索结果中的组合框框,我输入我,我期望从下拉菜单中选择iPhone应用程序,但什么也没有发生,因为它正在搜索的第一列即ID

Now when I go to search the combobox box within the results and I type "i", I expect to select "iphone App" from the drop down but nothing happens because it is searching the first column i.e ID

所以,我怎么能搜索姓名和自动完成组合框?或通过第二列搜索

So how can I search for the names and autocomplete the combobox? or search by second column

此外,为我展现的ID,如果我隐藏了ID专栏中,我可以通过名称就好了搜索,因为它是在结果集中仅有的一列是很重要的。

Also, It is important for me to show the ID, If I hide the ID column I can search by the Name just fine, since it is the only column in the result set.

推荐答案

的变通方法是显示名称,然后ID在ComboBox,所以,当我开始输入在ComboBox,默认情况下它,而不是ID自动完成名称。

The Workaround is to show Name and then ID in the Combobox, So when I start typing in the Combobox , it Autocompletes Name by Default instead of ID.

这篇关于MS Access 2010中多列组合框自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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