M
mike
Hi all,
In the list box I enable the multi-select to simple and I
can select more than one row in the list box. But how do I
add the selected items to an array of strings?
My list box has the result of:
Last Name | First Name
Doe John
Doe John Jr.
Doe, John should be assign to str(0) (string 1)
Doe, John Jr. Should be assign to str(1)(string 2)
Here is my code.
Dim ctrl As Control
Dim str() as string
dim i as interger
i=0
Set ctrl = Me.UserResult
For Each varItem In ctrl.ItemsSelected
str(i) = ctl.Column(0, varItem) & ","
i=i+1
Next
This code doesn't work and I'm getting errors. The error
is "Run time error'424', object require". How do i add the
selected items and assign it to the strings??
Thanks for the help
mike.
In the list box I enable the multi-select to simple and I
can select more than one row in the list box. But how do I
add the selected items to an array of strings?
My list box has the result of:
Last Name | First Name
Doe John
Doe John Jr.
Doe, John should be assign to str(0) (string 1)
Doe, John Jr. Should be assign to str(1)(string 2)
Here is my code.
Dim ctrl As Control
Dim str() as string
dim i as interger
i=0
Set ctrl = Me.UserResult
For Each varItem In ctrl.ItemsSelected
str(i) = ctl.Column(0, varItem) & ","
i=i+1
Next
This code doesn't work and I'm getting errors. The error
is "Run time error'424', object require". How do i add the
selected items and assign it to the strings??
Thanks for the help
mike.