cyberman55
Registered User.
- Local time
- Today, 15:49
- Joined
- Sep 22, 2012
- Messages
- 83
Hi all, I'm hoping one you CodingMeisters can help me out. I've got a very complex form going that updates MS charts based on user selections of a frame control (3) options, a treeview control (free download from http://www.jkp-ads.com/ and very nice all-code control solution) having 5 nodes (5 optiions) and two listboxes which, themselves populate via user selections. It's a complex mess, and I've posted on the query forum for ideas on that part of it. Currently I'm using an unwieldy set of case select statements to manage it. I believe I have 225 permutations of possibilities right now. Specifically 1) Space inventory from the tree (all, selected account, selected building, selected floor, selected room) times three from the option frame (inspected, not inspected, both) and then all the listbox selections (by space inventory, by supervisory zone, etc).
So, by way of example, users pick a node on the tree then:
1. Check the Option Frame selection. (3 choices)
2. Based on the Option Frame Selection (Check the ListShowBy selection) (5-9 choices depending on the Option Frame selection)
3. Based on the ListShowBy selection, sometimes also check the ListSpecifically For selection
5. Update the chart's rowsource (1 of 3 charts depending on the formatting needed)
Otherwise, User picks an Option Frame selection
1. Set the two listboxes and update the chart (the easy one, since I'm forcing the default.
Otherwise, pick a listshowby item then:
1. Check the option frame
2. Based on the option frame
3. Check the tree node level and selection and/or the listspecificallyfor listbox.
I know I could create a function that takes inputs such as which control was selected, and put all this nastiness in one place, but I can't see how I can get around having a huge set of case select statements nested within each other. Right now, I've got one case select statement using the option frame as the first level, the tree node as the second level, and the listshowby as the third level with some cases also requiring a select case on the listspecificallyfor control.
Tell me there's a better way to do this. I'm just a poor mechanical engineer with no CompSci training trying to do a software engineer's job.
Any tidbits would be appreciated, especially if they're tasty.
So, by way of example, users pick a node on the tree then:
1. Check the Option Frame selection. (3 choices)
2. Based on the Option Frame Selection (Check the ListShowBy selection) (5-9 choices depending on the Option Frame selection)
3. Based on the ListShowBy selection, sometimes also check the ListSpecifically For selection
5. Update the chart's rowsource (1 of 3 charts depending on the formatting needed)
Otherwise, User picks an Option Frame selection
1. Set the two listboxes and update the chart (the easy one, since I'm forcing the default.
Otherwise, pick a listshowby item then:
1. Check the option frame
2. Based on the option frame
3. Check the tree node level and selection and/or the listspecificallyfor listbox.
I know I could create a function that takes inputs such as which control was selected, and put all this nastiness in one place, but I can't see how I can get around having a huge set of case select statements nested within each other. Right now, I've got one case select statement using the option frame as the first level, the tree node as the second level, and the listshowby as the third level with some cases also requiring a select case on the listspecificallyfor control.
Tell me there's a better way to do this. I'm just a poor mechanical engineer with no CompSci training trying to do a software engineer's job.
Any tidbits would be appreciated, especially if they're tasty.