如何在组合框中使用2个或更多表? [英] How to use 2 or more tables in a combobox ?

查看:84
本文介绍了如何在组合框中使用2个或更多表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有以下问题:

Hi everyone, I have the following problem:

我有表1和Field PROGRAM

I have TABLE 1 with the Field PROGRAM

我有表2字段PROGRAM

I have TABLE 2 with the field PROGRAM

我有表3,其中FIELD表包含表1和表2

I have TABLE 3 with the FIELD table that contains TABLE 1 and TABLE 2

我有1个组合框,行源是TABLE 3(因此它将在下拉列表中向我显示表1和表2)

I have 1 combobox that the Row Source is TABLE 3 (so it will show me in the drop down list TABLES 1 and 2)

我有第二个组合框,它取决于我在第一个组合框中选择的表。如果我在第一个组合框中选择表1它需要向我显示表1中的程序,如果我选择表2它将显示表2中的程序。

I have the second combobox that depends on which TABLE I select in the first combobox. If I select in the first combobox TABLE 1 It needs to show me the PROGRAMS from TABLE 1, If I select TABLE 2 It will show me the PROGRAMS from TABLE 2.

我怎么能这样做? 

How could I do that ? 

推荐答案

嗨罗杰,

一个例子可能是:

Me.Combobox2.RowSource =" SELECT [Program] FROM" &安培; Me.Combobox1

Me.Combobox2.RowSource = "SELECT [Program] FROM " & Me.Combobox1

希望有所帮助......

Hope it helps...


这篇关于如何在组合框中使用2个或更多表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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