Excel, you're killing me! I originally posted thread 707-1651774 about a year and a half ago and I still get bitten by VBA.
So I have 2 pairs of combo boxes: SI & Step and Proj & Task
I populate comboSI.
The user selects an item.
In the AfterUpdate event I populate ComboStep. What goes into ComboStep varies depending upon the user's selection - that's why the delay to populate until comboSi.AfterUpdate.
The user clicks the dropdown arrow on ComboStep and selects an item.
Cool.............everything works.
A little further down the userform I have the other pair ComboProj and ComboTask. I go through the same routine - the user selects an item in ComboProj, I populate ComboTask, etc. The difference is that when the user clicks the dropdown arrow on ComboTask and selects an item we get nothing. The combo box remains empty. I can click the dropdown arrow again to repeat my selection and now I get a value populated into ComboTask.
I've built a tracer that displays events executing (basically displays the routine names). It goes:
ComboPlan_AfterUpdate
populateComboTask
ComboPlan_Exit
ComboTask_Enter
ComboTask_DropButtonClick
ComboTask_DropButtonClick
It executes the DropButtonClick event twice and we have no selection. Now a weird thing. If I put into the DropButtonClick event this code:
msgbox comboTask.listcount
Then the DropButtonClick event fires, the message box displays the count (it is 8), now we get a new sequence:
ComboTask_Change
ComboTask_Click
ComboTask_DropButtonClick
and bingo we have a value in the combo box control. I promise - the only change was to add the MSGBOX statement.
So I have 2 pairs of combo boxes: SI & Step and Proj & Task
I populate comboSI.
The user selects an item.
In the AfterUpdate event I populate ComboStep. What goes into ComboStep varies depending upon the user's selection - that's why the delay to populate until comboSi.AfterUpdate.
The user clicks the dropdown arrow on ComboStep and selects an item.
Cool.............everything works.
A little further down the userform I have the other pair ComboProj and ComboTask. I go through the same routine - the user selects an item in ComboProj, I populate ComboTask, etc. The difference is that when the user clicks the dropdown arrow on ComboTask and selects an item we get nothing. The combo box remains empty. I can click the dropdown arrow again to repeat my selection and now I get a value populated into ComboTask.
I've built a tracer that displays events executing (basically displays the routine names). It goes:
ComboPlan_AfterUpdate
populateComboTask
ComboPlan_Exit
ComboTask_Enter
ComboTask_DropButtonClick
ComboTask_DropButtonClick
It executes the DropButtonClick event twice and we have no selection. Now a weird thing. If I put into the DropButtonClick event this code:
msgbox comboTask.listcount
Then the DropButtonClick event fires, the message box displays the count (it is 8), now we get a new sequence:
ComboTask_Change
ComboTask_Click
ComboTask_DropButtonClick
and bingo we have a value in the combo box control. I promise - the only change was to add the MSGBOX statement.