[英]How can I create a Multiple Value Combo box on an Unbound Form
I need your help on MS Access 2007. 我需要你在MS Access 2007上的帮助。
I have a big problem with my MS Access Unbound Form. 我的MS Access Unbound Form存在很大问题。 How can I create a combo box i do not want bound to a table, show a multiple value List?
如何创建一个我不想绑定到表的组合框,显示多值List?
The Combo is named Sector and want these values to be selected in Multiples 9Which should be possible in Access 2007) from the Drop Down List: Fertilizer, Seeds, Pesticides, Veterinary products, Animal Feed, General. Combo被命名为Sector,并且希望从Multiples 9中选择这些值,这可以在Access 2007中从下拉列表中选择:肥料,种子,杀虫剂,兽医产品,动物饲料,一般。
Which Select Statement or VBA code can I use. 我可以使用哪个Select Statement或VBA代码。 I need a solution to handle this please.
我需要一个解决方案来解决这个问题。
Precisely a ListBox control will help you. 确切地说,ListBox控件可以帮助您。 Since you are using it in MS Access - it makes it much easier with the wizard where you can type the items list.
由于您在MS Access中使用它 - 使用向导可以更轻松地输入项目列表。 Or if you want to use VBA, then you can load the list using AddItem property of ListBox control in the Form_Load event.
或者,如果要使用VBA,则可以使用Form_Load事件中的ListBox控件的AddItem属性加载列表。
Here is one way of doing what you want: Open up the table your Form will use. 这是一种做你想做的事情的方法:打开你的表格将使用的表格。 Then: Datasheet view, Datasheet Tab, Lookup Column.
然后:数据表视图,数据表选项卡,查找列。 Select option: I will type in ... Next Under Col1 enter one of the user choices you want;
选择选项:我将输入...下一个在Col1下输入您想要的一个用户选项; for example A Dogs, then under that enter another choice;
例如A Dogs,然后进入另一个选择; for example B Cats, etc Next give your lookup column label a name or stay with the default.
例如B Cats等接下来给你的查阅列标签命名或保留默认值。 Finally, Check Allow Multiple Values box.
最后,选中“允许多个值”框。 Finish.
完。 You now have a table with a combo box that allows the user to select 0, 1 or many choices.
您现在有一个带有组合框的表,允许用户选择0,1或多个选项。 But you want it on a Form.
但是你想要它在表格上。 Create Tab, Click Form.
创建选项卡,单击表单。 You now have a Form that has a multi value combobox.
您现在有一个具有多值组合框的表单。 But you want it on a form you already created.
但是你想要它已经在你已经创建的表单上。 Right click the ComboBox.
右键单击ComboBox。 Copy.
复制。 Close the table and open the form you want the ComboBox to be a part of.
关闭表并打开您希望ComboBox成为其中一部分的表单。 Right click on a clean part of the form and Paste.
右键单击表单的干净部分并粘贴。 Hope this is what you were looking for.
希望这是你想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.