473,387 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

List Box multi values retrieval

553 512MB
I have a List Box with multi-select option = "Extended".

how can i retrieve all the values into a variable/array variable

i have tried but cant do like List4.Value(1) ..


help please

Thanks
Jul 16 '07 #1
1 1403
MikeTheBike
639 Expert 512MB
Hi

I have a List Box with multi-select option = "Extended".

how can i retrieve all the values into a variable/array variable

i have tried but cant do like List4.Value(1) ..


help please

Thanks
If you want to load ALL the list (column 0) values into an arry then this

Expand|Select|Wrap|Line Numbers
  1.     Dim arry() As String
  2.     Dim i As Integer
  3.  
  4.     With List4
  5.         ReDim arry(.ListCount - 1)
  6.         For i = 0 To .ListCount - 1
  7.             arry(i) = .Column(0, i)
  8.         Next i
  9.     End With
  10.  
If just the SELECTED items then this is one way

Expand|Select|Wrap|Line Numbers
  1.     Dim arry() As String
  2.     Dim i As Integer
  3.  
  4.     With List4
  5.         ReDim arry(.ListCount - 1)
  6.         For i = 0 To .ListCount - 1
  7.             If .Selected(i) Then
  8.                 ReDim Preserve arry(i)
  9.                 arry(i) = .Column(0, i)
  10.             End If
  11.         Next i
  12.     End With
  13.  
HTH

MTB
Jul 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Camiel | last post by:
Hi, I'm trying to do the following: create a form, with at the top a list of values drop-down box, filled with values from table A. Also at the top, an input box to enter a year. Below...
1
by: Berend | last post by:
I am trying to pass multi values into a where clause with an in clause in a store procedure to use in a Crystal report. This can change depending on the user. Maybe there is another way to pass...
2
by: Jared | last post by:
Store List Box values I have a form that has hundreds of records in it. The form has a list box with 10 different options in it. The user is able to select multiple options from the list box....
3
by: Manfred Braun | last post by:
Hi All, I try to list the values from an objects array member: FieldInfo fis = a.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance); for(int i = 0; i < fis.Length; i++) {
6
by: psbasha | last post by:
Hi, I am assigning the list/dict values to another list/dict variable as shown below. List : List1 = List2 = List1
9
by: Ajinkya | last post by:
Hello friends ! , I am very new to java script.If anyone can help me then I will be very very thankful to his/her. I am using php and mysql in my project and I have one textarea and one...
2
by: sanano3062000 | last post by:
HI i have inserted values into list box control using java script when i try to save the values in to data base values of list box control are lost.. This is called as lost of list box values on...
0
by: Mark C. Stock | last post by:
"Mark C. Stock" <mcstockX@Xenquery .comwrote in message news:... | | "Berend" <Berend.Brinkhuis@evatone.comwrote in message | news:bdd9ac20.0401271301.22cdb65e@posting.google.com... | | I am...
0
debasisdas
by: debasisdas | last post by:
The following sample code is designed to display the use of accepting a list of values in a single parameter and process the same in the where clause inside a procedure. STEP1:-First create an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.