ListBox Value List

D

DS

I'm trying to set a Listbox with a Value List in VBA but the actual list
itself is giving me problems.

Me.List5.RowSourceType = "Value List"
Me.List5.RowSource = (;1;"Main";2;"Mod";3;"Sub")
Me.List5.ColumnCount = 3
Me.List5.ColumnWidths = ".4 in;.4 in;4 in"

It's the rowsource......

Any help appreciated.
Thanks
DS
 
J

John W. Vinson

I'm trying to set a Listbox with a Value List in VBA but the actual list
itself is giving me problems.

Me.List5.RowSourceType = "Value List"
Me.List5.RowSource = (;1;"Main";2;"Mod";3;"Sub")
Me.List5.ColumnCount = 3
Me.List5.ColumnWidths = ".4 in;.4 in;4 in"

It's the rowsource......

Any help appreciated.
Thanks
DS

Well, what do you want to see?

It looks to me like your RowSource is suitable for a *two* column listbox
looking like

<null> 1
"Main" 2
"Mod" 3
"Sub" <undefined>

or perhaps

1 "Main"
2 "Mod"
3 "Sub"

If you want three columns, your rowsource should contain triplets of values,
for the three columns for each row.

What do you want the listbox to display, graphically? And what do you want it
to do?
 
D

DS

I want to see....
1 Main Item
2 Mod
3 Sub

I think the problem was I had three columns....when I needed two. It seems
to work now....
Thank You John
DS
 

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