select an item on a 1st list box pop up the second list box

select an item on a 1st list box pop up the second list box

Post by VGlt » Thu, 24 Aug 2006 04:06:02


I want to create a list box of items for the user's selection. When the user
selects an item from this list box, a second list box will pop up showing the
corresponding values of this item.

How can I do that? Any examples or code will be greatly appreciated.
Thank you,
tim
 
 
 

select an item on a 1st list box pop up the second list box

Post by V2F5bmUtSS » Thu, 24 Aug 2006 06:35:02

Hi Tim

This is quite a common question they are called Cascading lists

You need to set the control source of the 2nd list box to refer to the 1st
(hope that makes sense)

Something like this

SELECT TableName.FieldName FROM TableName
WHERE TableName.FieldName = [1stListName]
ORDER By TableName.FieldName;

On the AfterUpdate event of the 1st list box use this

Me![2ndListName].Requery

--
Wayne
Manchester, England.
Not an expert
Enjoy whatever it is you do



>> I want to create a list box of items for the user's selection. When the user >> selects an item from this list box, a second list box will pop up showing the >> corresponding values of this item. >> >> How can I do that? Any examples or code will be greatly appreciated. >> Thank you, >> tim

 
 
 

select an item on a 1st list box pop up the second list box

Post by VGlt » Fri, 25 Aug 2006 04:20:02

Hi Wayne,
Thank you for your help. I make it works! Here is the next question. How can
I save the data entered by the user's selection into my database? Do I have
to write the code to deal with this situation?

Tim



>> >>>> I want to create a list box of items for the user's selection. When the user >>>> selects an item from this list box, a second list box will pop up showing the >>>> corresponding values of this item. >>>> >>>> How can I do that? Any examples or code will be greatly appreciated. >>>> Thank you, >>>> tim