如何构建一个包含1300多个选项的组合框? [英] How to build a combo box with 1300+ options?

查看:105
本文介绍了如何构建一个包含1300多个选项的组合框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我是一名正在建立数据库以安置医院获得性感染的新手。我正在寻求关于如何构建一个包含1,300多种病原体列表的组合框的建议。表格上有三个字段要求病原体鉴定,因为它有1,300多个病原体可供选择。组合框是否适合这样做?我在excel电子表格和word文档中都有病原体。


专家们如何建议这样做?


非常感谢!

Hi All!

I''m a returning novice working on building a database to house Hospital Acquired Infections. I''m seeking advice on how to build a combo box with a list of over 1,300 pathogens. There are three fields on a form requesting Pathogen identification and as it stands I have 1,300 + pathogens to chose from. Is a combo box an appropriate way to do this? I have the pathogens in an excel spread sheet and in a word document.

How do the experts suggest to do this?

Many thanks!

推荐答案




我使用过这么多项目的组合框,但在这种情况下,用户会开始输入他们想要的内容并让Access选择值,因为它是被打字。使用这么多项目滚动实际列表是可能的但不实用。


您可以将Excel工作表导入数据库,并拥有一个包含病原体列表的表。然后你将使表格成为组合框的记录源。


理想情况下,如何设置它是为每个病原体提供一个ID号,然后是病原体名称。将组合框绑定到表时,您将有两列(一列用于ID,一列用于名称)...但是将列宽设置为0和2例如,以便使ID列消失(它仍然是组合框的一部分,只是不可见)。


通过将绑定列属性设置为1(ID),从组合框中选择一些内容将导致ID号存储在记录中而不是实际的病原体名称中。这是一种干净的方法,可以防止病原体名称在记录后获得重复记录。


Pat
Hi,

I have used combo boxes with this many items, but in those situations the user will start typing in what they want and have Access pick out the value as it is being typed. Scrolling through the actual list with this many items is possible but not practical.

You can import the Excel sheet into the database, and have a table that holds the pathogen list. Then you''ll make the table the combo box record source.

Ideally how you would set this up is to have an ID number for each pathogen, and then the pathogen name. When you bind the combo box to the table, you''ll have two columns (one for ID and one for name)...but set the column widths to 0" and 2" for instance, so as to make the ID column disappear (it will still be a part of the combo box, just not visible).

By setting the bound column property to 1 (the ID), selecting something from the combo box will cause the ID number to be stored in the record rather than the actual pathogen name. This is the clean approach that will prevent pathogen names from getting duplicated record after record.

Pat


@ zepphead80


感谢Pat!


在此期间,我问了一个问题,我想出了如何使用你的建议,这是'工作减去ID字段。


问题:我们将存储的有关病原体的信息旨在导出到CDC报告数据库,其中使用了实际的病原体名称。我应该按照您的建议继续进行并创建ID字段。如果是这样,ID是一个数字还是缩写(例如,Adenovirus = ADV)是什么意思?


非常感谢你的帮助,它非常清楚!
@zepphead80
Thanks Pat!

In the interim I asked the question, I figured out how to put to use your advice and it''s working minus the ID field.

Question for you: The information we will be storing concerning pathogens is intended to be exported to a CDC reporting database, where the actual pathogen name is used. Should I go ahead as you suggested and create an ID field. If so, what do you mean by ID a number or abbreviation (e.g, Adenovirus=ADV)?

Much thanks for your help, it was crystal clear!


你在不需要手持的情况下取得进步是件好事。


回答你的具体问题:
It''s good that you''re making progress without the need for hand-holding.

In answer to your specific questions :
  1. 是的。使用ID字段代替在该位置周围复制文本。它在很多层面都比较好。
  2. 使用AutoNumber字段代替其他任何内容。特别是在记录数量的情况下,您不希望为每条记录分配匹配的缩写。如果您有可以使用的预先存在的,唯一的缩写,但通常会将AutoNumber用于此类情况。

欢迎使用字节


这篇关于如何构建一个包含1300多个选项的组合框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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