如何向rowsource值添加其他值 [英] How to add additional values to a rowsource value

查看:101
本文介绍了如何向rowsource值添加其他值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单中有几个组合框,因为它们链接到更多信息(例如,customerprojectmanager,选中时不仅允许您选择项目管理器,而且还会将一大堆信息拖到后台。表单,如电话号码,电子邮件地址等等。)


到目前为止一切都很好,但是,添加新的项目经理我最初有一个名为管理工具的按钮,将允许您为所有不同的组合框添加新值,并再次,这工作正常。然而,根据权力,这是令人困惑的。


我被指示做的是有一个这样的列表:


名称1

名称2

名称3

添加新名称


显然第一部分可以是拿起来

I have several combo boxes in a form as they link to more information (for example customerprojectmanager, when selected would not only allow you to select the project manager, but would also then drag a whole load of information into the background of the form, such as telephone number, email address, etc, etc).

All is fine so far, however, to add new project managers I originally had a button called admin tools, that would allow you to add new values for all the different combo boxes and again, that worked fine. However, according to the powers that be, thats confusing.

What I have been instructed to do is have a list such as this:

Name1
Name2
Name3
Add New Name

where obviously the first part can be picked up with

展开 | 选择 | Wrap | 行号

推荐答案

添加添加新名称到你的桌子,所以它显示在列表的底部/顶部(如果需要,使用特殊字符)。然后,您可以在组合框的更新后事件中设置if语句,然后打开表单。这样的事情:

Add "Add New Name" to your table so it shows up at the bottom/top of your list (use a special character if you need). Then you can set up an if statement in the after update event of the combo box that would then open the form. Something like this:

展开 | 选择 | Wrap | 行号


您需要使用 UNION ALL 子句。使用 TOP 1 确保它只出现一次:

You need to add in an extra SELECT to your SQL using the UNION ALL clause. Use TOP 1 to ensure it only appears once :

展开 | 选择 | Wrap | 行号


我试过联盟所有代码,现在我得到一个完全空白的组合框。有什么想法吗?
I tried the Union All code, and now I am getting an entirely blank combo box. Any ideas why?


这篇关于如何向rowsource值添加其他值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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