Listbox selection to populate another listbox?

C

Chris Kettenbach

Hello all,
Quick question. I have a listbox that is populated by items from a database.
When the user select something from the list, I want to populate another
listbox based on the selection in the first.

Example lstCompany contains a list of company names with the primary key
field hidden. After user selects a company, I want to pass that primary key
back to a stored procedure and the 2nd listbox lstEmployees then be
populated with the employees from the selected company. Are there any
examples out there? Thanks everybody.

Chris
 
G

Guest

The concept is simple. Double click on the list box 1 or otherwise add the
change event to your code and wire it up (Handles with VB.NET += handler with
C#). Then, you can get the selected item (by Item or Value, depending) and
pass this to the next sproc. With a small number of items, you can do this
all with JavaScript, but I would not if you are running a huge number of
items.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top