自动完成功能不适用于ComboBox

自动完成功能不适用于ComboBox

本文介绍了ms access-自动完成功能不适用于ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ComboBox,其行源为

I have a ComboBox that has a row source of

SELECT tblTCOAppCodes.id,
       tblTCOAppCodes.tcoAppCode & " : " & tblTCOAppCodes.description AS Description
FROM tblTCOAppCodes
ORDER BY tblTCOAppCodes.tcoAppCode;

通常,组合框允许自动完成,但在这种情况下,它不允许自动填充,我认为这是因为我将2列中的值连接在一起.

Normally a combo-box allows auto-complete but in this case it does not and I'm assuming it's because I'm concatenating the values from 2 columns.

该列的外观截图.

推荐答案

它在这里确实有效(Access 2010,但这没关系).

It does work here (Access 2010, but that shouldn't matter).

我用您的字段名称和示例数据创建了一个表格,并在您的行源中创建了组合框.我添加了9900的Appcode,以便于测试.

I created a table with your field names and sample data, and the combo box with your row source. I added a Appcode of 9900 for easier testing.

我键入9,然后选择了该项目.或8302选择第三个项目.

I type 9, and the item is selected. Or 8302 to select the 3rd item.

您不希望能够输入例如Ent选择8301项目,对吗?这是不可能的,因为列字符串以8301开头.

You aren't expecting to be able to type e.g. Ent to select the 8301 item, are you? This isn't possible, because the column string starts with 8301.

如果需要,组合框必须具有3列,其中description是第二列=第一个可见列. tcoAppCode必须是最后一列.

If you want that, the combo box must have 3 columns, with description being the second one = the first visible one. tcoAppCode would have to be the last column.

这篇关于ms access-自动完成功能不适用于ComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 01:15