Combining ItemData and Column

aziz rasul

Active member
Local time
Today, 21:21
Joined
Jun 26, 2000
Messages
1,935
I have the following code: -

Code:
        For Each varItem In Me!cboCountry.ItemsSelected
            strCountry = strCountry & ",'" & Me!cboCountry.ItemData(varItem) & "'"
        Next varItem

However I want to extract the value in the 2nd column. How do I amend the code to do this?
 
i think..

For Each varItem In Me!cboCountry.ItemsSelected
strCountry = strCountry & ",'" & Me!cboCountry.column(2).ItemData(varItem) & "'"
Next varItem

i cant remember if the column count is 0 based so try changin it to 1 before you try anythin else.
 
You got me on the right direction. I amended it to get it to work and it is 0 based. Here's the code. Thanks for the help.

For Each varItem In Me!cboCountry.ItemsSelected
strCountry = strCountry & ",'" & Me!cboCountry.column(1,varItem) & "'"
Next varItem
 

Users who are viewing this thread

Back
Top Bottom