MacRena
asked on
Need Column(1) in ItemData(varItm)
Hello Experts,
Can anyone help me get the second column from a 2 column List Box?
I can get the Bound column like this...
For Each varItm In Me!MyList.ItemsSelected
strSQL = strSQL & Me!lstCustomers.ItemData(v arItm)
strSQL = strSQL & "','"
intCount = intCount + 1
Next varItm
But how do I work Column(1) into that?
In otherwords, I would like to get the second column (the unbound column) of the 2 column list.
I tried...
Me!lstCustomers.ItemData(v arItm).Col umn(1)
("Object Required")
and...
Me!lstCustomers.Column(1). ItemData(v arItm)
("Object Required")
and...
Me!lstCustomers.ItemData(v arItm, 1)
("Wrong Number of Arguments")
and...
Me!lstStateAreaCode.Column (1)
(returns "")
Any ideas?
Thanks,
Mac
Can anyone help me get the second column from a 2 column List Box?
I can get the Bound column like this...
For Each varItm In Me!MyList.ItemsSelected
strSQL = strSQL & Me!lstCustomers.ItemData(v
strSQL = strSQL & "','"
intCount = intCount + 1
Next varItm
But how do I work Column(1) into that?
In otherwords, I would like to get the second column (the unbound column) of the 2 column list.
I tried...
Me!lstCustomers.ItemData(v
("Object Required")
and...
Me!lstCustomers.Column(1).
("Object Required")
and...
Me!lstCustomers.ItemData(v
("Wrong Number of Arguments")
and...
Me!lstStateAreaCode.Column
(returns "")
Any ideas?
Thanks,
Mac
ASKER
Hi Nico,
I'm not sure what you are suggesting...
I already tried...
Me!lstCustomers.ItemData(v arItm).Col umn(1)
("Object Required")
do you mean? ...
Me!lstStateAreaCode.varItm .Column(1)
("Object doesn't support this property or method"
Can you please add a little more of the line so I can tell what your syntax would be?
Thanks,
Mac
I'm not sure what you are suggesting...
I already tried...
Me!lstCustomers.ItemData(v
("Object Required")
do you mean? ...
Me!lstStateAreaCode.varItm
("Object doesn't support this property or method"
Can you please add a little more of the line so I can tell what your syntax would be?
Thanks,
Mac
ASKER
Oops, I'm getting 2 rountines mixed up...
Don't worry that there seems to be a problem with the name of the list box. There is one called lstCustomers, and one called lstStateAreaCode. They both are trying to do the same thing.
Mac
Don't worry that there seems to be a problem with the name of the list box. There is one called lstCustomers, and one called lstStateAreaCode. They both are trying to do the same thing.
Mac
I'm referring to varItm as a listboxitem "on itself".
The [for each] should offer the Item "itself" with the columns as property.
Got the idea?
Nic;o)
The [for each] should offer the Item "itself" with the columns as property.
Got the idea?
Nic;o)
ASKER
Hmmm, I'm sorry, Nico. I'm not sure I follow you...
This is what exposes the VALUE of the Bound Column, or Column(0), in a loop through the selected List Items
Me!lstStateAreaCode.ItemDa ta(varItm)
Now, you suggest that varItm is a "ListBoxItem" unto itself.
You also suggest that varItm exposes it's Columns property, and that I should be able to return the values of those Colunms.
Help says "The ItemData property returns the data in the bound column for the specified row" That would be varItm, wouldn't it? I mean, varItm would be the DATA in the Bound Column(0) that was returned by .ItemData().
I'm not understanding how you suggest that I would expose the DATA in the Column(1) from that.
Would you please write me a statement illustrating what your syntax might look like?
Thank you very much.
Mac
This is what exposes the VALUE of the Bound Column, or Column(0), in a loop through the selected List Items
Me!lstStateAreaCode.ItemDa
Now, you suggest that varItm is a "ListBoxItem" unto itself.
You also suggest that varItm exposes it's Columns property, and that I should be able to return the values of those Colunms.
Help says "The ItemData property returns the data in the bound column for the specified row" That would be varItm, wouldn't it? I mean, varItm would be the DATA in the Bound Column(0) that was returned by .ItemData().
I'm not understanding how you suggest that I would expose the DATA in the Column(1) from that.
Would you please write me a statement illustrating what your syntax might look like?
Thank you very much.
Mac
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello Nico,
Yes, that was perfect. Thanks so much - Again!
Mac
Yes, that was perfect. Thanks so much - Again!
Mac
Nic;o)