Problem with Hierarchical ListBoxes

Hi there,
I have tried the example for creating a Hierarchical ListBox from here. However, it only shows the folder with the small icon to expand. But clicking on this does not reveal the sub items.
The code which I have put into the open event of the listbox is:

Dim i, u as Integer Dim s1,sub1 as String Me.columnwidths="150,0" s1="Michigan,Ohio,Minnesota" sub1="Grand Blanc,Bad Axe,Flint,Benton Harbor,Detroit;Cleveland,Columbus,Akron,Pleasantville;St. Paul,Frostbite Falls" u=CountFields(s1,",") For i=1 to u If NthField(sub1,";",i)<> "" then Me.AddFolder "" Me.Cell(i-1,1)=NthField(sub1,";",i) End if Me.Cell(i-1,0)=NthField(s1,",",i) Next Me.ColumnCount=1

Any ideas why this isn’t working?

You need to also implement the ExpandRows event. When you click the triangle this event is fired where you add the new rows. You don’t have to use InsertRow, in this event AddRow and AddFolder will automatically place them after the row being expanded.

Thanks Will. I just worked that out. The LR isn’t clear here as it stated that code was for when the user “double clicks” a collapsed element.