By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,640 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,640 IT Pros & Developers. It's quick & easy.

Creating one loop to control multiple conditional/cascading combo boxes

P: 3
On my form I have 24 combo boxes ( 12 of which are conditional/cascading combo boxes dependent on the users input of the other 12 combo boxes).


I've found ways to do it by code each individual combo box ( http://stackoverflow.com/questions/7624318/vb-net-cascading-comboboxes-connected-to-dataset-from-access-changing-units). But I would really like to lean the code out and have it all in one spot.

I was thinking about putting this code in the form_afterupdate event. What do you think? Let me know if you need more information.
Nov 25 '12 #1
Share this Question
Share on Google+
4 Replies


P: 3
Here is a video to help clarify.

http://www.youtube.com/watch?v=0YVeL...hannel&list=UL
Nov 25 '12 #2

zmbd
Expert Mod 5K+
P: 5,397
I know that in VBA I can call a sub and pass information to that sub or function. I would suspect that you should be able to do the same for your dot-net.... so I would think that in the afterupdate event of the CBO on the right (parent) that you could call the sub to update the child CBO passing to it the information from the parent.
Not being conversant in dot-net I'm afraid that's all I can offer; hopefully someone here with more understanding will be of more help or maybe I've been able to tickle the ole-brain cells :)
Nov 26 '12 #3

P: 3
give me an example of what of the vba code would look like if at all possible. I might be able to translate it.

If anyone else has any ideas/thoughts please share
Nov 26 '12 #4

zmbd
Expert Mod 5K+
P: 5,397
rhuseman:
What I would do in VBA is use the parameters part of the sub statment to pass into the call the information I needed for the conditions. Here's the basic syntax and an example: Sub Statement.

Now, because you have so little information about what your record sources are for the combo boxs it is impossible to provide more than the outline/pseudo-code:
Expand|Select|Wrap|Line Numbers
  1. Sub Z_Example (byval "strTblNam" AS String, _
  2.  byval "strCallingParent")
  3.  
  4. '<Some code here to Declare the variables record sets/>
  5.  
  6. '<Some code here to trap errors/>
  7.  
  8. '<Some code here to create an SQL based on the table name
  9. '   in Access I'd call the table definition to fetcht
  10. '   the field names./>
  11.  
  12. '<Some more code here to to set the child/> 
  13.  
  14. '<Some more code to do what ever/>
  15.  
  16. END SUB
Nov 27 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.