简体   繁体   English

如何在未绑定表单上创建多值组合框

[英]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.

相关问题 如何在组合框中获取未绑定列的值? - How can I get the value of an unbound column in a combo box? 如何在组合框中返回未绑定列的值 - How to return value of unbound column in combo box 将未绑定的组合框添加到可以触发BeforeUpdate()事件的窗体吗? - Add unbound combo box to form that can trigger a BeforeUpdate() event? 无法在访问权限的未绑定组合框中选择项目 - Can not select an item in an unbound combo box in access 当 MS-Access 表单上的另一个组合框的值被修改时,如何更新该表单上的组合框? - How do I update a combo box on an MS-Access form when the value of another combo box on that form is modified? 基于表单中的组合框创建报表 - Create a Report based on a value from Combo box in form 在连续形式中,我可以让组合框根据其自己记录中的字段或文本框值使用不同的查询吗? - In a continuous form, can I have a combo box use a different query depending on a field or text box value within its own record? 在 MS Access 组合框中,如何使用表单值作为 class - In MS Access combo box,how to use form value as where class 如何在 Access 表单的组合框中使用通配符作为查询选项? - How can I use a wildcard as an option with a query in a combo box in an Access form? 如何启动查找表单,并从组合框中返回值 - How to launch a Look up form, and return the value from a combo box
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM