组合框基于另一个领域填充 [英] combobox filled based on another field

查看:85
本文介绍了组合框基于另一个领域填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个名为frm_detail的表格

在表格上我有两个名为

cbo_soort

cbo_fase


cbo_soort有de项目(我使用点来分隔项目,不能把桌子放到位)


ID_soort ..... Soort_traject

1 ................. nieuw

2 ................. verlenging

3 ................. uitbreiding

4 ................. anders


cbo_fase基于名为Q_fase的查询。哪个有物品;


ID_fase ..... Fase ....... Soort_traject

1 ......... ....... fase 1 ..... N

2 ................ fase 1a .... V
3 ................ fase 1b .... B

4 ............ .... fase 2 ..... B

5 ................ fase 3 ..... B


问题:我希望能够做到以下几点;


如果cbo_soort =" 2"那么我希望cbo_fase中的列表只显示Soort_traject为V或B的项目(所以N应该被丢弃)


如果cbo_soort =<> " 2英寸那么我希望cbo_fase中的列表仅显示Soort_traject为N的项目。或B


我正试图找到标准的解决方案。在字段Soort_traject中的Q_fase qury中的一部分但是我不知道怎么做...


任何帮助都会非常感激。

谢谢,

Pierkes

Hi,"

I have a form called "frm_detail"
On the form i have two combobaxes called

cbo_soort
cbo_fase

cbo_soort has de items (i use dots to seperate the items, cannot put a table in place)

ID_soort.....Soort_traject
1.................nieuw
2.................verlenging
3.................uitbreiding
4.................anders

cbo_fase is based on a Query called "Q_fase" which has the items;

ID_fase.....Fase.......Soort_traject
1................fase 1.....N
2................fase 1a....V
3................fase 1b....B
4................fase 2.....B
5................fase 3.....B

Question: I would like to be able to do the following;

If cbo_soort = "2" then i would like the list in cbo_fase to only show the items where Soort_traject is V or B (so N should be discarded)

If cbo_soort = <> "2" then i would like the list in cbo_fase to only show the items where Soort_traject is "N" or "B"

I am trying to find a solution for the "criteria" part in the Q_fase qury on the field "Soort_traject" but i can''t figure out how to do this...

Any help would really be appreciated.
Thanks,
Pierkes

推荐答案

在cbo_soort的After_UPdate事件中,您想要更改另一个组合框的rowsource属性。如果组合框rowsourcetype属性为table / query,则可以使用查询字符串填充rowsource。


您是否可以使用VBA形成必要的查询字符串?


吉姆
In the After_UPdate event of cbo_soort you want to change the rowsource property of the other combo box. You can fill the rowsource with a query string if the combo box rowsourcetype property is "table/query".

Are you able to use VBA to form the necessary query string?

Jim


你好吉姆,


是的,如果我可以使用VBA,那么,是什么字符串应该是...... ???我不知道,你能帮忙吗?


谢谢,

Pierkes
Hi Jim,

Yes, if nessesary i can use VBA, however, what the string should be...??? i do''nt know, can you help ?

thanks,
Pierkes


展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


这篇关于组合框基于另一个领域填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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