【发布时间】:2012-10-23 17:56:01
【问题描述】:
我有一个关于如何链接一个列表框上的选定项目并以相同形式显示在另一个列表框上的问题...这就是我想要的:
我有一个名为 category 的表,它具有以下值:
category table:
categorynumber (primary key) int not null,
categoryname varchar() not null,
Parentcategory (foreign key refering to categorynumber)int not null,
categoryfollowingnumber int not null.
我想从类别、子类别和子子类别中进行选择。因此
listbox1(category1),
listbox2(subcategory based on category1)
listbox3 (sub-sub category based on subcategory)
listbox1: select category: Car
listbox2: display: toyota
listbox3: display: toyota corola
我可以在 listbox1 中看到 category1,但是基于所选类别的链接是我卡住的地方。我必须使用子表单还是可以在单个表单上使用?
【问题讨论】:
-
到目前为止你有没有尝试过?
-
@djadmin..是的,到目前为止,我首先使用了以下步骤:我在一个表单中创建了三个列表框;在 listbox1 rowResource:我查询所有主要类别(它有效,我只看到我想要的主要类别)。然后在更新后的 listbox1 事件中,我使用以下代码在 listbox2 中显示子类别: Me.listbox2.Rowsource = Me.listbox1.Rowsource 后跟 Me.listbox2.Requery ......但我在 listbox2 上看不到任何内容,我想如果我可以修复以查看 listbox2 上的子类别,那么我也可以在 listbox3 上看到 ..所有值都在 FK 和 PK 中的一个表中。 thx..luis