By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

Refer to multiple columns in Multi Select

P: n/a
Hi,

I'm using the following code to build a concatenated string from a
multi-select combo.

For Each varItem In Forms!frmreports!Combo1.ItemsSelected
strSQL = strSQL & Forms!frmreports!Combo1.ItemData(varItem) & " OR
[ID]="
Next varItem

This retrieves the values form the first column in the multi-select. How do
I retrieve the second column which is not a numeric ID but a text field?

Thanks

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Tue, 27 Jan 2004 13:48:59 -0700, "Terri" <Te***@spamaway.com> wrote:
Hi,

I'm using the following code to build a concatenated string from a
multi-select combo.

For Each varItem In Forms!frmreports!Combo1.ItemsSelected
strSQL = strSQL & Forms!frmreports!Combo1.ItemData(varItem) & " OR
[ID]="
Next varItem

This retrieves the values form the first column in the multi-select. How do
I retrieve the second column which is not a numeric ID but a text field?

Thanks


Just use Column instead of ItemData. Pass the column number you want as the
first argument (first column is number 0), and pas varItem as the second
parameter.
Nov 12 '05 #2

P: n/a
Thanks Steve, Can you give a code example.
thanks again

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:ra********************************@4ax.com...
On Tue, 27 Jan 2004 13:48:59 -0700, "Terri" <Te***@spamaway.com> wrote:
Hi,

I'm using the following code to build a concatenated string from a
multi-select combo.

For Each varItem In Forms!frmreports!Combo1.ItemsSelected
strSQL = strSQL & Forms!frmreports!Combo1.ItemData(varItem) & " OR[ID]="
Next varItem

This retrieves the values form the first column in the multi-select. How doI retrieve the second column which is not a numeric ID but a text field?

Thanks
Just use Column instead of ItemData. Pass the column number you want as

the first argument (first column is number 0), and pas varItem as the second
parameter.

Nov 12 '05 #3

P: n/a
OK, based on the code you provided...

With Forms!frmreports!Combo1
For Each varItem In .ItemsSelected
strSQL = strSQL & .ItemData(varItem) & " OR [ID]="
strItemTextList = _
strItemTextList & .Column(1, varItem) & ", "
Next varItem
End With

On Tue, 27 Jan 2004 14:03:42 -0700, "Terri" <Te***@spamaway.com> wrote:
Thanks Steve, Can you give a code example.
thanks again

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:ra********************************@4ax.com.. .
On Tue, 27 Jan 2004 13:48:59 -0700, "Terri" <Te***@spamaway.com> wrote:
>Hi,
>
>I'm using the following code to build a concatenated string from a
>multi-select combo.
>
>For Each varItem In Forms!frmreports!Combo1.ItemsSelected
> strSQL = strSQL & Forms!frmreports!Combo1.ItemData(varItem) & "OR >[ID]="
>Next varItem
>
>This retrieves the values form the first column in the multi-select. Howdo >I retrieve the second column which is not a numeric ID but a text field?
>
>Thanks
>
>


Just use Column instead of ItemData. Pass the column number you want as

the
first argument (first column is number 0), and pas varItem as the second
parameter.


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.