Working with multiple listboxes on one form

TravelingCat

Registered User.
Local time
Today, 21:20
Joined
Feb 22, 2010
Messages
42
Hello
I have a form (which is a subform) called frmAssignments. In the Form Header there's the "main" listbox, which contains assignments. Each assignment can have a subassignment, so when i click on one that has, another listbox opens (it was defined invisible before the click). In the same way, this subassignment can also have subassignment, and so on and so on. Let's say it can go up to 10 levels of subassignments (i don't believe it will be more than that). The question is, should i create 10 invisible listboxes, with the same code behind the click event and make them visible when needed, just as i did with this one? Or is there a way to do this more nicely? Some way that won't require all this code.
Will appreciate any suggestions
 
The term is cascading listboxes. You're not going to find this to be an easy task with 10 listboxes. But here's the concept using a combo box:

http://baldyweb.com/CascadingCombo.htm

A combo box and a list box are essentially the same so you can adapt it to your needs.
 
Thanks vbaInet, i'll give it a shot.
 
I think the better approach would be a tree view that expand into nodes, thus simulating cascading list/combo boxes.

Here are a few examples
 

Attachments

  • treeview1.jpg
    treeview1.jpg
    105 KB · Views: 410
  • treeview2.JPG
    treeview2.JPG
    53.7 KB · Views: 379
  • treeview4.JPG
    treeview4.JPG
    58 KB · Views: 363
Last edited:
I think the better approach would be a tree view that expand into nodes, thus simulating cascading list/combo boxes.
Quite advanced stuff but would do if the OP has intermediate to advanced programming skills and is ready to take the plunge. Have you got any sample db's?
 
Hi DCrake,
I already tried to make something out of this tree thing, but it didn't go so well, so i quit. First of all i need multiple columns, but all i found in the net refered to one-column tree, second of all i need all the nodes to be right aligned, which as i understood is not supported.
So i used listbox to solve this, of course it's not as pretty and has limitations. I limited the sublists to 10, and wrote a code for each one. Turned out to be ok.. but i have another problem, about which i'm going to post a new thread.
Thanks you both for trying to help:)
 

Users who are viewing this thread

Back
Top Bottom