两个列表框 [英] two listboxes

查看:68
本文介绍了两个列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我有2个列表框。 listbox1必须从tasklist获取值。 listbox 2必须从personlist中获取值。


当我选择listbox1值时,它应该显示coressponding值。到列表框2


list1有任务列表中的任务名。

list2必须显示人员列表中的值。


例如(点击(list1)办公室应该显示(list2)员工姓名等)


帮助我

hi all


i ve 2 listboxes. listbox1 has to get value from tasklist. listbox 2 has to get value from personlist.

when i select listbox1 value it should show the coressponding value. to the listbox 2

list1 has tasknames from tasklist.
list2 has to display values from personlist.

for eg( clicking(list1) office it should show (list2) employee name, etc)

help me

推荐答案

在listbox1的AfterUpdate事件中输入一些代码,使用WHERE子句将listbox2.ControSource设置为某个SQL,只选择与listbox1中的值匹配的数据。
In the AfterUpdate event of listbox1 enter some code to set the listbox2.ControSource to some SQL with the WHERE clause, selecting only the data that matches the value in listbox1.



在listbox1的AfterUpdate事件中输入一些代码,将listbox2.ControSource设置为带有WHERE子句的某些SQL,只选择与listbox1中的值匹配的数据。
In the AfterUpdate event of listbox1 enter some code to set the listbox2.ControSource to some SQL with the WHERE clause, selecting only the data that matches the value in listbox1.



轻微修正。


这不是必须重置的listbox2.ControlSource。这应该是空的,除非你想要存储在字段中的值。


这是listbox2.RowSource必须设置为sql语句,其条件基于选择listbox1。

Slight correction.

It''s not the listbox2.ControlSource that has to be reset. This should be empty unless you want the value stored in a field.

It''s the listbox2.RowSource that has to be set to a sql statement with criteria based on the selection in listbox1.


Adrian


你犯了一个错误。你怎么了< grin>


Mary
Adrian

You made a mistake. How unlike you. <grin>

Mary



轻微修正。


这不是必须重置的listbox2.ControlSource。这应该是空的,除非你想要存储在字段中的值。


这是listbox2.RowSource必须设置为sql语句,其条件基于选择ListBox1中。
Slight correction.

It''s not the listbox2.ControlSource that has to be reset. This should be empty unless you want the value stored in a field.

It''s the listbox2.RowSource that has to be set to a sql statement with criteria based on the selection in listbox1.



它的工作原理但看到当我点击listbox1值时,只有list2必须显示值。

每个taskid下的
至少参与其中的人。 list1有4taskid。当我点击该taskid时,它应该在list2中显示4个人的详细信息。

its working but see when i click the listbox1 value only the list2 has to display the value.

under each taskid atleast person involved in it. list1 has 4taskid. when I click that taskid it should display 4 person details in list2.


这篇关于两个列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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