Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to create multiple listboxes in same collumn? Ken C[_2_] Excel Discussion (Misc queries) 0 September 25th 09 07:50 PM
Userform with Multiple ListBoxes not working ExcelMonkey[_190_] Excel Programming 6 March 3rd 05 11:29 PM
Userform w/ Multiple listboxes that link miker1999[_13_] Excel Programming 1 April 27th 04 03:22 AM
Userform w/ Multiple listboxes that link miker1999[_12_] Excel Programming 0 April 20th 04 12:35 PM
Userform and reading multiple listboxes Bijl167[_6_] Excel Programming 3 December 8th 03 01:40 PM


All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"