Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple Listboxes - Listbox2.value doesn't get set
Hi
I got a problem using multiple listboxes. I have 3 of them: Listbox 1-3 If I click another option in 1 it reloads 2 with new info. The same if I click in box 2 with box 3. The marked line doesn't set Listbox2.value to anything, just "". There is a value in YY(0).nodeName I'm confused as to why: The same line in UserForm_Initialize works fine. Any ideas where I'm going wrong? Thanks David F. Option Explicit Dim MsDom As DOMDocument Sub UserForm_Initialize() Dim XX As IXMLDOMNodeList Dim Itm As IXMLDOMNode Set MsDom = CreateObject("MSXML.DOMDocument") MsDom.Load ("c:\dwgs\fx2005\fxlayersXML.xml") MsDom.async = False Set XX = MsDom.selectNodes("/layers/*") ' all of selected layers With ListBox1 For Each Itm In XX .AddItem Itm.nodeName ' puts each of the layer names into the lisbox Next End With ListBox1.Value = XX(0).nodeName ' goes to LB2 change End Sub Sub ListBox1_Change() ' 1 Dim ChldNode As IXMLDOMNodeList Dim Itm As IXMLDOMNode Dim YY As IXMLDOMNodeList Set YY = MsDom.selectNodes("/layers/" & ListBox1.Value & "/*") With ListBox2 .Clear ' removes items from listbox2 For Each Itm In YY .AddItem Itm.nodeName Next End With Debug.Print YY(0).nodeName ListBox2.Value = YY(0).nodeName ' goes to LB2.change but value not set - why? End Sub Sub ListBox2_Change() ' 2 Dim Itm As IXMLDOMNode Dim ZZ As IXMLDOMNodeList Debug.Print "/layers/" & ListBox1.Value & "/" & ListBox2.Value & "/x " Set ZZ = MsDom.selectNodes("/layers/" & ListBox1.Value & "/" & ListBox2.Value & "/x") With ListBox3 .Clear ' removes items from listbox3 For Each Itm In ZZ .AddItem Itm.Text ' puts each of the serials sizes into the lisbox Next End With End Sub ' listbox2 change Sub CboCancel_Click() Me.Hide End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a way to create multiple listboxes in same collumn? | Excel Discussion (Misc queries) | |||
Userform with Multiple ListBoxes not working | Excel Programming | |||
Userform w/ Multiple listboxes that link | Excel Programming | |||
Userform w/ Multiple listboxes that link | Excel Programming | |||
Userform and reading multiple listboxes | Excel Programming |