Linked Listboxs

R

Rod Gill

Hi,

I want to have two Listboxes side by side in a windows form.

Listbox1 will have a list of Programs
I want Listbox2 to show a list of all projects belonging to the selected
program and for listbox2 to update when each program is selected in
Listbox1.

Visual Basic Professional 2005

I've tried help, but help seems worse than ever. I've tried 7 or 8 different
searches and I get 500+ results on anything but listboxes and what's in the
first page of results is for VB 2003 or earlier!@#@!

Help much appreciated
 
R

Rod Gill

I have bound the list boxes to the data in SQL Server, I just need to link
the two boxes so the second only shows data related to the first.
 
R

Rod Gill

Edit the binding source properties to add a Filter. Programmatically modify
the filter whenever the first listbox selected value changes. Seems to work
a treat.
 
G

Guest

How are you going to retrieve the information? Database, folder/file reader?
Are you hard coding the program list? Xml?

At some point your going to have to write some code and build a framework
for your data and then decide how to store and retrieve it.

Here's a tip to get you started. You could index your programs list in the
data column and then use this to retrieve the set of projects to fill in your
second list box. Such as "Funny Code", "FC" or just "1" then however your
saving your project data have the index as part of it so that it identifies
itself with your program.

Randy
 
R

Rod Gill

Hi,

I've bound the controls to respective related tables and they display data
as expected. I just need to limit what's in the second listbox to the
selected, related master record in the first ListBox.

I've done it now by using a Filter on the binding source object

Thanks.
 

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

Top