添加“添加新记录";进入查找列表 [英] Adding a "Add New record" into a Lookup List

查看:86
本文介绍了添加“添加新记录";进入查找列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以在查找字段(显示的下拉列表)中添加链接,以打开查找源的NewForm?我有一个应用程序,用户可以在一个列表中选择项目名称,但是有时还没有添加该项目,因此希望有一种方法,他们可以在下拉列表中单击"AddNew"列出,而不是退出记录,然后在创建项目后返回.

我以为是在2007年做到这一点,但我无法一辈子在2010年解决这个问题,有人可以帮忙吗?

谢谢
M.

Is there a way to add a link in a lookup field (dropdownlist that displays)that would open the NewForm of the lookup''s source? I have a app that has the user select the project name in one list, but there will be times when the project won''t be added yet, it would be prefered to have a way they can just click "AddNew" in the dropdown list instead of backing out of the record and then going back in after they create a project.

I did this in 2007 I thought, but can not for the life of me figure this out in 2010, can anyone help?

Thanks
M.

推荐答案

一种方法是在SELECT中使用UNION(假设您正在使用SQL):
One way is to use a UNION in your SELECT (assuming that you are using SQL):
SELECT CompanyName FROM Suppliers
 UNION SELECT "Add New"


或者,当然:


Or, of course:

SELECT "Add New"
  UNION SELECT CompanyName FROM Suppliers



如果您要从数据库中选择多个列,则可能会出现问题.



This can become problematic if you are selecting more than one column from the database though.


这篇关于添加“添加新记录";进入查找列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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