capturing the values from a combo box into an xml file

  • Thread starter DowningDevelopments
  • Start date
D

DowningDevelopments

iv got a simple multi select combo box which takes the values from a range of
cells (its a concept design im trying to show that this works).

That part works, what i need to do is capture those values and then put them
into an xml file which we can ADO into a database.

im stuck on actually grabbing the values from the comboBox, how do i access
the array its storing them in, i can write a while look and go through it but
i dont know how to access the data.

any help?

Amit
 
J

james.billy

iv got a simple multi select combo box which takes the values from a range of
cells (its a concept design im trying to show that this works).

That part works, what i need to do is capture those values and then put them
into an xml file which we can ADO into a database.

im stuck on actually grabbing the values from the comboBox, how do i access
the array its storing them in, i can write a while look and go through itbut
i dont know how to access the data.

any help?

Amit

I assume you mean Listbox rather than combo box (as far as I know you
can't have a multiselect combo box in vba)

Is the control on a form or a worksheet, if its on a form you would
use something like the following attached to a command button so once
the user has finished selecting you can add to the xml sheet:

For i = 0 To Me.ListBox1.ListCount - 1 ' listboxes are zero based
If Me.ListBox1.Selected(i) Then ' if the item is selected then
tmpStr = tmpStr & vbCr & Me.ListBox1.List(i, 0)
End If
Next i
MsgBox tmpStr

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top