
June 21st, 2005, 03:02 PM
|
|
Contributing User
|
|
Join Date: May 2004
Posts: 134
Time spent in forums: 13 h 39 m 31 sec
Reputation Power: 5
|
|
Quote: | Originally Posted by Lunchbox I can't seem to pinpoint the command to let me link one combo box to another so that when I select a certain option it will enable ComboBox2 I have on the userform, and if I select something else it will enable ComboBox3 on the userform. I have figured out how to do this with option buttons, but the combo box always has baffled me. |
in the controlsource of your comboboxes is where the magic happens. Your "combobox1" will not need to be altered. However, the controlsource of the "combobox2" will need to be queried based on the first combobox. where the two comboboxes are related(ID, most likely), you need to make the combobox2 controlsource field equal to the combobox value on your form. so, for example, if you are basing your connection on the id in the table, then you would make the ids equal. in the controlsource query for combobox2(in the "criteria section), just say =forms![formname]![comboboxname] for the id, or whatever you are comparing. then, all you have to do is go into the code for the onclick event for combobox1 and say combobox2.requery. this tells combobox2 to "refresh" when you click on the first combobox.
kinda hard to explain. let me know if it makes sense for ya
*j
|