Hello,
Can someone help me with this weird behavior?
I have a template that has three combo boxes and a listbox. The functionality is to select values for the combo boxes
and after selection for the third combo box the listbox populates with a couple of default values. Then the user goes on to double click
the first value in the list box (1stlistbox_Dbclick event fires) and the children of the first default value populates and goes on selecting with the desired value.
The list box is populated with the default values except that it is not enabled/activated to double click. While I was trying to troubleshoot I observed that if I go to design mode and come back the listbox activates and thereafter everything works as expected.
I have four templates with the same code and the same funcationality but only two of them show such behaviour.
P.S These were built using Excel 2003 and now I am working on 2007.
'Third Combo Box
Private Sub cmbxReview_Change()
Dim strDivLvl As String
Dim blnCancel As MSForms.ReturnBoolean
With Worksheets(Excelparams)
If (cmbxReview.Value = .range("Sel_DivLvl").Value) Then
Exit Sub
Else
strDivLvl = cmbxReview.Value
.range("Sel_DivLvl").Value = strDivLvl
End If
If lstDivision.ListCount = 0 Then
Call InitList(lstDivision, .range("Division").Value)
If .range("LoggedOn") Then
Call lstDivision_DblClick(blnCancel)
End If
End If
End With
End Sub
'----------------------------------------------------------------------------------------------------------
Public Sub InitList(ByRef lstListBox As MSForms.ListBox, Optional ByVal sName As String)
lstListBox.Clear
If Len(sName) > 0 Then
With lstListBox
.AddItem sName
.AddItem CStr(Space(SPACE_INDENTS) & "END"), 1
End With
End If
End Sub
'-----------------------------------------------------------------------------------------------------------------
Private Sub lstDivision_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
'On Error Resume Next
With Me.lstDivision
If .ListIndex < 0 Then
Exit Sub
End If
Call AddChildrenOfList(lstDivision, .List(.ListIndex))
End With
End Sub
Bookmarks